Skip to content

Commit

Permalink
More post-rebase fixes, add missing flush call
Browse files Browse the repository at this point in the history
  • Loading branch information
prokopyl committed Mar 25, 2024
1 parent 2ef375f commit 25902af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/macos/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ impl Window {
WindowHandle { state: window_state }
}

pub fn has_focus(&mut self) -> bool {
pub fn has_focus(&self) -> bool {
unsafe {
let view = self.inner.ns_view.as_mut().unwrap();
let view = self.ns_view;
let window: id = msg_send![view, window];
if window == nil {
return false;
Expand All @@ -278,9 +278,9 @@ impl Window {
}
}

pub fn focus(&mut self) {
pub fn focus(&self) {
unsafe {
let view = self.inner.ns_view.as_mut().unwrap();
let view = self.ns_view;
let window: id = msg_send![view, window];
if window != nil {
msg_send![window, makeFirstResponder:view]
Expand Down
4 changes: 2 additions & 2 deletions src/x11/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ impl Window {
self.close_requested.set(true);
}

pub fn has_focus(&mut self) -> bool {
pub fn has_focus(&self) -> bool {
unimplemented!()
}

pub fn focus(&mut self) {
pub fn focus(&self) {
unimplemented!()
}

Expand Down
1 change: 1 addition & 0 deletions src/x11/x11_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ impl X11Window {

pub fn show(&self, connection: &XcbConnection) -> Result<(), Box<dyn Error>> {
connection.conn2.map_window(self.window_id)?;
connection.conn2.flush()?;
Ok(())
}

Expand Down

0 comments on commit 25902af

Please sign in to comment.