Skip to content

Commit

Permalink
Make window a GTK layer shell.
Browse files Browse the repository at this point in the history
This change adds the gtk-layer-shell package and uses it to turn
windows built on linux into layer shells to allow for more
flexibility in their usage.
  • Loading branch information
TheCodedProf committed Apr 27, 2024
1 parent dc71a8d commit d8e0675
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ serde = { version = "1", optional = true, features = [ "serde_derive" ] }
raw-window-handle = "0.5"
bitflags = "1"
crossbeam-channel = "0.5"
gtk-layer-shell = "0.3.0"
gdk-sys = "0.15.1"
gdk = "0.15.4"

[dev-dependencies]
image = "0.24"
Expand Down
5 changes: 5 additions & 0 deletions src/platform_impl/linux/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ use raw_window_handle::{
XlibWindowHandle,
};

use gtk_layer_shell;

use crate::{
dpi::{LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize, Position, Size},
error::{ExternalError, NotSupportedError, OsError as RootOsError},
Expand Down Expand Up @@ -87,6 +89,9 @@ impl Window {
.application(app)
.accept_focus(attributes.focused)
.build();

gtk_layer_shell::init_for_window(&window);

let window_id = WindowId(window.id());
event_loop_window_target
.windows
Expand Down

0 comments on commit d8e0675

Please sign in to comment.