[gtk+] quartz: Make GdkQuartzScreen a plain object
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] quartz: Make GdkQuartzScreen a plain object
- Date: Fri, 17 Nov 2017 18:55:02 +0000 (UTC)
commit a62e75964cd17825a1a9354945aa153433f16e06
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Nov 17 13:35:24 2017 -0500
quartz: Make GdkQuartzScreen a plain object
No need to derive this from GdkScreen anymore.
gdk/quartz/gdkquartzscreen.h | 4 ----
gdk/quartz/gdkscreen-quartz.c | 25 ++++++++-----------------
gdk/quartz/gdkscreen-quartz.h | 6 ++----
3 files changed, 10 insertions(+), 25 deletions(-)
---
diff --git a/gdk/quartz/gdkquartzscreen.h b/gdk/quartz/gdkquartzscreen.h
index f6a2659..87a6e2e 100644
--- a/gdk/quartz/gdkquartzscreen.h
+++ b/gdk/quartz/gdkquartzscreen.h
@@ -34,11 +34,7 @@ G_BEGIN_DECLS
#define GDK_IS_QUARTZ_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_QUARTZ_SCREEN))
#define GDK_QUARTZ_SCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_QUARTZ_SCREEN,
GdkQuartzScreenClass))
-#ifdef GDK_COMPILATION
typedef struct _GdkQuartzScreen GdkQuartzScreen;
-#else
-typedef GdkScreen GdkQuartzScreen;
-#endif
typedef struct _GdkQuartzScreenClass GdkQuartzScreenClass;
diff --git a/gdk/quartz/gdkscreen-quartz.c b/gdk/quartz/gdkscreen-quartz.c
index b4b8490..e1f1299 100644
--- a/gdk/quartz/gdkscreen-quartz.c
+++ b/gdk/quartz/gdkscreen-quartz.c
@@ -70,21 +70,17 @@ static void display_reconfiguration_callback (CGDirectDisplayID displ
static gint get_mm_from_pixels (NSScreen *screen, int pixels);
-G_DEFINE_TYPE (GdkQuartzScreen, gdk_quartz_screen, GDK_TYPE_SCREEN);
+G_DEFINE_TYPE (GdkQuartzScreen, gdk_quartz_screen, G_TYPE_OBJECT);
static void
-gdk_quartz_screen_init (GdkQuartzScreen *quartz_screen)
+gdk_quartz_screen_init (GdkQuartzScreen *screen)
{
- GdkScreen *screen = GDK_SCREEN (quartz_screen);
NSDictionary *dd = [[[NSScreen screens] objectAtIndex:0] deviceDescription];
NSSize size = [[dd valueForKey:NSDeviceResolution] sizeValue];
- _gdk_screen_set_resolution (screen, size.width);
+ gdk_quartz_screen_calculate_layout (screen);
- gdk_quartz_screen_calculate_layout (quartz_screen);
-
- CGDisplayRegisterReconfigurationCallback (display_reconfiguration_callback,
- screen);
+ CGDisplayRegisterReconfigurationCallback (display_reconfiguration_callback, screen);
quartz_screen->emit_monitors_changed = FALSE;
}
@@ -100,8 +96,7 @@ gdk_quartz_screen_dispose (GObject *object)
screen->screen_changed_id = 0;
}
- CGDisplayRemoveReconfigurationCallback (display_reconfiguration_callback,
- screen);
+ CGDisplayRemoveReconfigurationCallback (display_reconfiguration_callback, screen);
G_OBJECT_CLASS (gdk_quartz_screen_parent_class)->dispose (object);
}
@@ -194,7 +189,7 @@ gdk_quartz_screen_calculate_layout (GdkQuartzScreen *screen)
}
void
-_gdk_quartz_screen_update_window_sizes (GdkScreen *screen)
+_gdk_quartz_screen_update_window_sizes (GdkQuartzScreen *screen)
{
GList *windows, *list;
@@ -206,9 +201,6 @@ _gdk_quartz_screen_update_window_sizes (GdkScreen *screen)
* This data is updated when the monitor configuration is changed.
*/
- /* FIXME: At some point, fetch the root window from GdkScreen. But
- * on OS X will we only have a single root window anyway.
- */
_gdk_root->x = 0;
_gdk_root->y = 0;
_gdk_root->abs_x = 0;
@@ -222,7 +214,7 @@ _gdk_quartz_screen_update_window_sizes (GdkScreen *screen)
static void
process_display_reconfiguration (GdkQuartzScreen *screen)
{
- gdk_quartz_screen_calculate_layout (GDK_QUARTZ_SCREEN (screen));
+ gdk_quartz_screen_calculate_layout (screen);
_gdk_quartz_screen_update_window_sizes (GDK_SCREEN (screen));
}
@@ -270,8 +262,7 @@ display_reconfiguration_callback (CGDirectDisplayID display,
*/
if (!screen->screen_changed_id)
{
- screen->screen_changed_id = gdk_threads_add_idle (screen_changed_idle,
- screen);
+ screen->screen_changed_id = gdk_threads_add_idle (screen_changed_idle, screen);
g_source_set_name_by_id (screen->screen_changed_id, "[gtk+] screen_changed_idle");
}
}
diff --git a/gdk/quartz/gdkscreen-quartz.h b/gdk/quartz/gdkscreen-quartz.h
index 5a1cfa3..1741393 100644
--- a/gdk/quartz/gdkscreen-quartz.h
+++ b/gdk/quartz/gdkscreen-quartz.h
@@ -19,13 +19,11 @@
#ifndef __GDK_QUARTZ_SCREEN__
#define __GDK_QUARTZ_SCREEN__
-#include <gdkscreenprivate.h>
-
G_BEGIN_DECLS
struct _GdkQuartzScreen
{
- GdkScreen parent_instance;
+ GObject parent_instance;
GdkDisplay *display;
@@ -43,7 +41,7 @@ struct _GdkQuartzScreen
struct _GdkQuartzScreenClass
{
- GdkScreenClass parent_class;
+ GObjectClass parent_class;
};
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]