changeset 2896:87640dd90e16

Fix fullscreen spanning multiple monitors Commit a16635c ("Fix fullscreen - remove all the garbage which breaks things and let Gtk do its job.") broke fullscreen spanning multiple monitors. Fix this for GTK3 by using gdk_window_set_fullscreen_mode(). Fixes #650. Unfortunately, GTK2 has no equivalent.
author Jiri Bohac <jbohac@suse.cz>
date Fri, 07 Dec 2018 00:30:22 +0100
parents b20a96b979a3
children 2dfbd0b6e8cc
files src/fullscreen.c
diffstat 1 files changed, 16 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/fullscreen.c	Sat Nov 03 17:53:31 2018 +0000
+++ b/src/fullscreen.c	Fri Dec 07 00:30:22 2018 +0100
@@ -248,13 +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) {
@@ -281,6 +274,22 @@
 			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);