Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use wl protocol for keeping it centered #81

Merged
merged 5 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading