Skip to content

Commit 5cfcf70

Browse files
committed
wayland: Use protocol for keeping above and being centered
1 parent 13c6b07 commit 5cfcf70

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

meson.build

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ executable(
2323
dependency('gtk4'),
2424
dependency('polkit-agent-1'),
2525
dependency('polkit-gobject-1'),
26+
dependency('pantheon-wayland-1'),
2627
meson.get_compiler('vala').find_library('posix')
2728
],
2829
c_args: [

src/PolkitDialog.vala

+12-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* https://github.com/solus-project/budgie-desktop
2424
*/
2525

26-
public class Ag.PolkitDialog : Granite.MessageDialog {
26+
public class Ag.PolkitDialog : Granite.MessageDialog, PantheonWayland.ExtendedBehavior {
2727
public signal void done ();
2828
public bool was_canceled = false;
2929

@@ -123,6 +123,17 @@ public class Ag.PolkitDialog : Granite.MessageDialog {
123123

124124
update_idents ();
125125
select_session ();
126+
127+
child.realize.connect (() => {
128+
connect_to_shell ();
129+
set_keep_above ();
130+
make_centered ();
131+
132+
var surface = get_surface ();
133+
if (surface is Gdk.Toplevel) {
134+
((Gdk.Toplevel) surface).inhibit_system_shortcuts (null);
135+
}
136+
});
126137
}
127138

128139
private void update_idents () {

0 commit comments

Comments
 (0)