Skip to content

Commit

Permalink
Use wl protocol for keeping it centered (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
leolost2605 committed Aug 22, 2024
1 parent 6765d0e commit 9c63b84
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Install Dependencies
run: |
apt update
apt install -y libgranite-7-dev libgtk-4-dev libpolkit-agent-1-dev libpolkit-gobject-1-dev meson valac
apt install -y libgranite-7-dev libgtk-4-dev libpantheon-wayland-1-dev libpolkit-agent-1-dev libpolkit-gobject-1-dev meson valac
- name: Build
env:
DESTDIR: out
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ You'll need the following dependencies:
* libadwaita-1-dev
* libgranite-7-dev (>= 7.0.0)
* libgtk-4-dev
* libpantheon-wayland-1-dev
* libpolkit-gobject-1-dev
* libpolkit-agent-1-dev
* meson
Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ executable(
dependency('gtk4'),
dependency('polkit-agent-1'),
dependency('polkit-gobject-1'),
dependency('pantheon-wayland-1'),
meson.get_compiler('vala').find_library('posix')
],
c_args: [
Expand Down
13 changes: 12 additions & 1 deletion src/PolkitDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* https://github.com/solus-project/budgie-desktop
*/

public class Ag.PolkitDialog : Granite.MessageDialog {
public class Ag.PolkitDialog : Granite.MessageDialog, PantheonWayland.ExtendedBehavior {
public signal void done ();
public bool was_canceled = false;

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

update_idents ();
select_session ();

child.realize.connect (() => {
connect_to_shell ();
set_keep_above ();
make_centered ();

var surface = get_surface ();
if (surface is Gdk.Toplevel) {
((Gdk.Toplevel) surface).inhibit_system_shortcuts (null);
}
});
}

private void update_idents () {
Expand Down

0 comments on commit 9c63b84

Please sign in to comment.