[gtk+/wip/otte/gtk4: 18/127] display: Insist that backends implement the monitor vfuncs



commit 032b2c792e500487ca3995ebf7ac722a8fc1887d
Author: Benjamin Otte <otte redhat com>
Date:   Fri Sep 9 14:52:06 2016 +0200

    display: Insist that backends implement the monitor vfuncs
    
    We cannot fallback anymore once we remove the ability to query screen
    size, and that's about to happen.

 gdk/gdkdisplay.c |   29 -----------------------------
 1 files changed, 0 insertions(+), 29 deletions(-)
---
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 5d49aad..e7f0463 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -2545,32 +2545,6 @@ gdk_display_get_n_monitors (GdkDisplay *display)
   return GDK_DISPLAY_GET_CLASS (display)->get_n_monitors (display);
 }
 
-static GdkMonitor *
-get_fallback_monitor (GdkDisplay *display)
-{
-  static GdkMonitor *monitor = NULL;
-  GdkScreen *screen;
-
-  if (monitor == NULL)
-    {
-      g_warning ("%s does not implement the monitor vfuncs", G_OBJECT_TYPE_NAME (display));
-      monitor = gdk_monitor_new (display);
-      gdk_monitor_set_manufacturer (monitor, "fallback");
-      gdk_monitor_set_position (monitor, 0, 0);
-      gdk_monitor_set_scale_factor (monitor, 1);
-    }
-
-  screen = gdk_display_get_default_screen (display);
-  gdk_monitor_set_size (monitor,
-                        gdk_screen_get_width (screen),
-                        gdk_screen_get_height (screen));
-  gdk_monitor_set_physical_size (monitor,
-                                 gdk_screen_get_width_mm (screen),
-                                 gdk_screen_get_height_mm (screen));
-
-  return monitor;
-}
-
 /**
  * gdk_display_get_monitor:
  * @display: a #GdkDisplay
@@ -2588,9 +2562,6 @@ gdk_display_get_monitor (GdkDisplay *display,
 {
   g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
 
-  if (GDK_DISPLAY_GET_CLASS (display)->get_monitor == NULL)
-    return get_fallback_monitor (display);
-
   return GDK_DISPLAY_GET_CLASS (display)->get_monitor (display, monitor_num);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]