File: 0002-Ref-539-Run-time-check-on-GDK-display-backend.patch

package info (click to toggle)
geeqie 1%3A1.6-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 17,112 kB
  • sloc: ansic: 103,819; xml: 12,121; cpp: 2,087; sh: 1,056; makefile: 601; awk: 160; perl: 140
file content (86 lines) | stat: -rw-r--r-- 2,471 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
From: =?utf-8?q?Andreas_R=C3=B6nnquist?= <gusnan@debian.org>
Date: Thu, 10 Dec 2020 19:04:10 +0100
Subject: Ref #539: Run time check on GDK display backend

 This is two upstream patches combined:

   fa91a270d420a7fcdb38ebb40332d14c4e2f4492 and
   8768ab3d7588019ea07a440a9cfd12679bc07d65


---
 src/layout.c | 37 +++++++++++++++++++++++--------------
 1 file changed, 23 insertions(+), 14 deletions(-)

diff --git a/src/layout.c b/src/layout.c
index ab62348..685e200 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -2410,8 +2410,15 @@ void layout_sync_options_with_current_state(LayoutWindow *lw)
 
 #ifdef GDK_WINDOWING_X11
 #if GTK_CHECK_VERSION(3,10,0)
-	window = gtk_widget_get_window(GTK_WIDGET(lw->window));
-	lw->options.workspace = gdk_x11_window_get_desktop(window);
+	GdkDisplay *display;
+
+	display = gdk_display_get_default();
+
+	if (GDK_IS_X11_DISPLAY(display))
+		{
+		window = gtk_widget_get_window(GTK_WIDGET(lw->window));
+		lw->options.workspace = gdk_x11_window_get_desktop(window);
+		}
 #endif
 #endif
 	return;
@@ -2520,23 +2527,28 @@ gboolean release_cb(GtkWidget *widget, GdkEventButton *event, gpointer data)
 	return defined_mouse_buttons(widget, event, data);
 }
 
-#ifdef GDK_WINDOWING_X11
-#if GTK_CHECK_VERSION(3,10,0)
 static gboolean move_window_to_workspace_cb(gpointer data)
 {
+#ifdef GDK_WINDOWING_X11
+#if GTK_CHECK_VERSION(3,10,0)
 	LayoutWindow *lw = data;
 	GdkWindow *window;
+	GdkDisplay *display;
 
-	if (lw->options.workspace != -1)
+	display = gdk_display_get_default();
+
+	if (GDK_IS_X11_DISPLAY(display))
 		{
-		window = gtk_widget_get_window(GTK_WIDGET(lw->window));
-		gdk_x11_window_move_to_desktop(window, lw->options.workspace);
+		if (lw->options.workspace != -1)
+			{
+			window = gtk_widget_get_window(GTK_WIDGET(lw->window));
+			gdk_x11_window_move_to_desktop(window, lw->options.workspace);
+			}
 		}
-
-	return FALSE;
-}
 #endif
 #endif
+	return FALSE;
+}
 
 LayoutWindow *layout_new_with_geometry(FileData *dir_fd, LayoutOptions *lop,
 				       const gchar *geometry)
@@ -2612,11 +2624,8 @@ LayoutWindow *layout_new_with_geometry(FileData *dir_fd, LayoutOptions *lop,
 		gtk_window_move(GTK_WINDOW(lw->window), lw->options.main_window.x, lw->options.main_window.y);
 		if (lw->options.main_window.maximized) gtk_window_maximize(GTK_WINDOW(lw->window));
 //			}
-#ifdef GDK_WINDOWING_X11
-#if GTK_CHECK_VERSION(3,10,0)
+
 		g_idle_add(move_window_to_workspace_cb, lw);
-#endif
-#endif
 		}
 	else
 		{