[gtk/matthiasc/for-master: 10/11] x11: Fix getting the primary monitor
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 10/11] x11: Fix getting the primary monitor
- Date: Sat, 8 Aug 2020 16:02:42 +0000 (UTC)
commit bb30a2300454f0792bbedcc19bbeb51a8348f41c
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Aug 8 10:17:06 2020 -0400
x11: Fix getting the primary monitor
Actually return the primary monitor.
Fixes: #3038
gdk/x11/gdkdisplay-x11.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 414d6dc63e..269ae28829 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -2859,15 +2859,14 @@ gdk_x11_display_get_primary_monitor (GdkDisplay *display)
GdkX11Display *self = GDK_X11_DISPLAY (display);
GdkMonitor *monitor;
- if (0 <= self->primary_monitor)
- return NULL;
-
monitor = g_list_model_get_item (G_LIST_MODEL (self->monitors), self->primary_monitor);
if (monitor == NULL)
- return NULL;
+ monitor = g_list_model_get_item (G_LIST_MODEL (self->monitors), 0);
/* because g_list_model_get_item() returns a ref */
- g_object_unref (monitor);
+ if (monitor)
+ g_object_unref (monitor);
+
return monitor;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]