changeset 2876:9408af32ed62

Fix #650, 651: fullscreen does not work over multiple monitors https://github.com/BestImageViewer/geeqie/issues/650
author Jiří Boháč <>
date Wed, 19 Dec 2018 10:10:10 +0000
parents 198c76b748e0
children 92494a7432e9
files src/fullscreen.c
diffstat 1 files changed, 17 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/fullscreen.c	Tue Dec 18 16:42:02 2018 +0000
+++ b/src/fullscreen.c	Wed Dec 19 10:10:10 2018 +0000
@@ -248,14 +248,6 @@
 	gtk_window_set_decorated(GTK_WINDOW(fs->window), FALSE);
 	gtk_container_set_border_width(GTK_CONTAINER(fs->window), 0);
 
-	/* make window fullscreen -- let Gtk do it's job, don't screw it in any way */
-	gtk_window_fullscreen(GTK_WINDOW(fs->window));
-
-	/* move it to requested screen */
-	if (options->fullscreen.screen >= 0) {
-		gtk_window_set_screen(GTK_WINDOW(fs->window), screen);
-	}
-
 	/* keep window above others, if requested */
 	if (options->fullscreen.above) {
 		gtk_window_set_keep_above(GTK_WINDOW(fs->window), TRUE);
@@ -281,6 +273,23 @@
 			GDK_HINT_WIN_GRAVITY | GDK_HINT_USER_POS | GDK_HINT_USER_SIZE);
 
 	gtk_widget_realize(fs->window);
+#if GTK_CHECK_VERSION(3,8,0)
+	if ((options->fullscreen.screen % 100) == 0)
+		{
+		GdkWindow *gdkwin;
+		gdkwin = gtk_widget_get_window(fs->window);
+		if (gdkwin != NULL)
+			gdk_window_set_fullscreen_mode(gdkwin, GDK_FULLSCREEN_ON_ALL_MONITORS);
+		}
+#endif
+	/* make window fullscreen -- let Gtk do it's job, don't screw it in any way */
+	gtk_window_fullscreen(GTK_WINDOW(fs->window));
+
+	/* move it to requested screen */
+	if (options->fullscreen.screen >= 0)
+		{
+		gtk_window_set_screen(GTK_WINDOW(fs->window), screen);
+		}
 
 	fs->imd = image_new(FALSE);