Skip to content

Commit

Permalink
Center the polkit dialog (#664)
Browse files Browse the repository at this point in the history
  • Loading branch information
fossfreedom authored Jan 25, 2025
1 parent 2cdcbd9 commit b462ad1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/dialogs/polkit/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ pkversion = '>= 0.105'
polkit_deps = [
dep_giounix,
dep_gtk3,
dep_gtk_layer_shell,
dep_xfce4windowing,
link_libconfig,
link_libtheme,
link_libsession,
Expand All @@ -59,6 +61,7 @@ executable(
'--pkg', 'gio-unix-2.0',
'--pkg', 'budgie-config',
'--pkg', 'gtk+-3.0',
'--pkg', 'libxfce4windowing-0',
'--pkg', 'polkit-gobject-1',
'--pkg', 'polkit-agent-1',
'--pkg', 'posix',
Expand Down
8 changes: 7 additions & 1 deletion src/dialogs/polkit/polkitdialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,13 @@ namespace Budgie {
combobox_idents.add_attribute(render, "text", 0);
combobox_idents.set_id_column(0);

window_position = Gtk.WindowPosition.CENTER_ALWAYS;
// center dialog on the primary screen
var primary_monitor = libxfce4windowing.Screen.get_default().get_primary_monitor();
GtkLayerShell.init_for_window(this);
GtkLayerShell.set_layer(this, GtkLayerShell.Layer.TOP);
GtkLayerShell.set_monitor(this, primary_monitor.get_gdk_monitor());
GtkLayerShell.set_anchor(this, GtkLayerShell.Edge.LEFT, false);
GtkLayerShell.set_anchor(this, GtkLayerShell.Edge.TOP, false);

key_release_event.connect(on_key_release);

Expand Down

0 comments on commit b462ad1

Please sign in to comment.