From 2910f12fcfc7321df5709666019dba43b8276f81 Mon Sep 17 00:00:00 2001 From: PM Kuipers Date: Tue, 7 May 2024 14:00:15 +0200 Subject: [PATCH] Fixed fullscreen issue --- mediaserver/mediaserver.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mediaserver/mediaserver.py b/mediaserver/mediaserver.py index 78d6f5c..2bad2e8 100755 --- a/mediaserver/mediaserver.py +++ b/mediaserver/mediaserver.py @@ -95,10 +95,15 @@ class MediaService(dbus.service.Object): css_provider.load_from_data(css) context = Gtk.StyleContext() screen = Gdk.Screen.get_default() + display = screen.get_display() + monitor = display.get_monitor(0) + geom = monitor.get_geometry() + w = geom.width + h = geom.height context.add_provider_for_screen(screen, css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION) - self.window.add(self.imagebox) + self.window.set_size_request(w,h) self.window.fullscreen() pass @@ -115,6 +120,8 @@ class MediaService(dbus.service.Object): image = Gtk.Image() image.set_from_file(imfile) + image.set_halign(Gtk.Align.CENTER) + image.set_valign(Gtk.Align.CENTER) self.loadImage(image) def loadImageData(self,data):