Skip to content

Commit ae554b3

Browse files
committed
Center Global Config after window resize
Assure Global Config window will remain on the center of the screen after window is resized.
1 parent 7652c60 commit ae554b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

qubes_config/global_config/global_config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
import gi
5858

5959
gi.require_version("Gtk", "3.0")
60-
from gi.repository import Gtk, GLib, GObject, Gio
60+
from gi.repository import Gtk, GLib, GObject, Gio, Gdk
6161

6262
logger = logging.getLogger("qubes-global-config")
6363

@@ -314,6 +314,10 @@ def do_activate(self, *args, **kwargs):
314314
else:
315315
height = self.main_window.get_allocated_height()
316316
self.main_window.resize(width, height)
317+
self.main_window.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
318+
self.main_window.set_gravity(Gdk.Gravity.CENTER)
319+
self.main_window.move(0, 0)
320+
self.main_window.set_position(Gtk.WindowPosition.CENTER)
317321

318322
# open at specified location
319323
if self.open_at:

0 commit comments

Comments
 (0)