Skip to content

Commit

Permalink
is_foreground_window stubs for other backends
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKnauth committed May 23, 2024
1 parent e4055ec commit d174e43
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions druid-shell/src/backend/gtk/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,10 @@ impl WindowHandle {
}
}

pub fn is_foreground_window(&self) -> bool {
true
}

pub fn set_window_state(&mut self, size_state: window::WindowState) {
use window::WindowState::{Maximized, Minimized, Restored};
let cur_size_state = self.get_window_state();
Expand Down
4 changes: 4 additions & 0 deletions druid-shell/src/backend/mac/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,10 @@ impl WindowHandle {
}
}

pub fn is_foreground_window(&self) -> bool {
true
}

pub fn get_window_state(&self) -> WindowState {
unsafe {
let window: id = msg_send![*self.nsview.load(), window];
Expand Down
4 changes: 4 additions & 0 deletions druid-shell/src/backend/wayland/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ impl WindowHandle {
self.inner.surface.get_size()
}

pub fn is_foreground_window(&self) -> bool {
true
}

pub fn set_window_state(&mut self, _current_state: window::WindowState) {
tracing::warn!("set_window_state is unimplemented on wayland");
}
Expand Down
4 changes: 4 additions & 0 deletions druid-shell/src/backend/web/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,10 @@ impl WindowHandle {
Size::new(0.0, 0.0)
}

pub fn is_foreground_window(&self) -> bool {
true
}

pub fn content_insets(&self) -> Insets {
warn!("WindowHandle::content_insets unimplemented for web.");
Insets::ZERO
Expand Down
4 changes: 4 additions & 0 deletions druid-shell/src/backend/x11/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1718,6 +1718,10 @@ impl WindowHandle {
}
}

pub fn is_foreground_window(&self) -> bool {
true
}

pub fn set_window_state(&self, _state: window::WindowState) {
warn!("WindowHandle::set_window_state is currently unimplemented for X11 backend.");
}
Expand Down

0 comments on commit d174e43

Please sign in to comment.