[gtk/wip/chergert/quartz4u] add frame clock to surface
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/quartz4u] add frame clock to surface
- Date: Tue, 28 Apr 2020 00:46:15 +0000 (UTC)
commit fa85aa31ac323d04c66a0c93279c996a62fc8181
Author: Christian Hergert <chergert redhat com>
Date: Mon Apr 27 17:45:19 2020 -0700
add frame clock to surface
gdk/macos/gdkmacosdragsurface-private.h | 1 +
gdk/macos/gdkmacosdragsurface.c | 3 +++
gdk/macos/gdkmacospopupsurface-private.h | 1 +
gdk/macos/gdkmacospopupsurface.c | 13 ++++++++-----
gdk/macos/gdkmacossurface.c | 21 +++++++++++++++++----
gdk/macos/gdkmacostoplevelsurface-private.h | 1 +
gdk/macos/gdkmacostoplevelsurface.c | 4 ++++
7 files changed, 35 insertions(+), 9 deletions(-)
---
diff --git a/gdk/macos/gdkmacosdragsurface-private.h b/gdk/macos/gdkmacosdragsurface-private.h
index 2fcba16c82..94dec116fc 100644
--- a/gdk/macos/gdkmacosdragsurface-private.h
+++ b/gdk/macos/gdkmacosdragsurface-private.h
@@ -34,6 +34,7 @@ typedef struct _GdkMacosDragSurfaceClass GdkMacosDragSurfaceClass;
GType _gdk_macos_drag_surface_get_type (void);
GdkMacosSurface *_gdk_macos_drag_surface_new (GdkMacosDisplay *display,
GdkSurface *parent,
+ GdkFrameClock *frame_clock,
int x,
int y,
int width,
diff --git a/gdk/macos/gdkmacosdragsurface.c b/gdk/macos/gdkmacosdragsurface.c
index c975b230f5..000eb8f602 100644
--- a/gdk/macos/gdkmacosdragsurface.c
+++ b/gdk/macos/gdkmacosdragsurface.c
@@ -63,15 +63,18 @@ _gdk_macos_drag_surface_init (GdkMacosDragSurface *self)
GdkMacosSurface *
_gdk_macos_drag_surface_new (GdkMacosDisplay *display,
GdkSurface *parent,
+ GdkFrameClock *frame_clock,
int x,
int y,
int width,
int height)
{
g_return_val_if_fail (GDK_IS_MACOS_DISPLAY (display), NULL);
+ g_return_val_if_fail (!frame_clock || GDK_IS_FRAME_CLOCK (frame_clock), NULL);
g_return_val_if_fail (!parent || GDK_IS_MACOS_SURFACE (parent), NULL);
return g_object_new (GDK_TYPE_MACOS_DRAG_SURFACE,
"display", display,
+ "frame-clock", frame_clock,
NULL);
}
diff --git a/gdk/macos/gdkmacospopupsurface-private.h b/gdk/macos/gdkmacospopupsurface-private.h
index 2f48c4cd07..6b243d70fb 100644
--- a/gdk/macos/gdkmacospopupsurface-private.h
+++ b/gdk/macos/gdkmacospopupsurface-private.h
@@ -34,6 +34,7 @@ typedef struct _GdkMacosPopupSurfaceClass GdkMacosPopupSurfaceClass;
GType _gdk_macos_popup_surface_get_type (void);
GdkMacosSurface *_gdk_macos_popup_surface_new (GdkMacosDisplay *display,
GdkSurface *parent,
+ GdkFrameClock *frame_clock,
int x,
int y,
int width,
diff --git a/gdk/macos/gdkmacospopupsurface.c b/gdk/macos/gdkmacospopupsurface.c
index 20fc01b548..085f9e16ad 100644
--- a/gdk/macos/gdkmacospopupsurface.c
+++ b/gdk/macos/gdkmacospopupsurface.c
@@ -64,16 +64,19 @@ _gdk_macos_popup_surface_init (GdkMacosPopupSurface *self)
GdkMacosSurface *
_gdk_macos_popup_surface_new (GdkMacosDisplay *display,
- GdkSurface *parent,
- int x,
- int y,
- int width,
- int height)
+ GdkSurface *parent,
+ GdkFrameClock *frame_clock,
+ int x,
+ int y,
+ int width,
+ int height)
{
g_return_val_if_fail (GDK_IS_MACOS_DISPLAY (display), NULL);
+ g_return_val_if_fail (!frame_clock || GDK_IS_FRAME_CLOCK (frame_clock), NULL);
g_return_val_if_fail (!parent || GDK_IS_MACOS_SURFACE (parent), NULL);
return g_object_new (GDK_TYPE_MACOS_POPUP_SURFACE,
"display", display,
+ "frame-clock", frame_clock,
NULL);
}
diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c
index ddf0ce3520..e34c222ee2 100644
--- a/gdk/macos/gdkmacossurface.c
+++ b/gdk/macos/gdkmacossurface.c
@@ -22,6 +22,7 @@
#include <AppKit/AppKit.h>
#include <gdk/gdk.h>
+#include "gdkframeclockidleprivate.h"
#include "gdksurfaceprivate.h"
#include "gdkmacosdragsurface-private.h"
@@ -88,22 +89,34 @@ _gdk_macos_surface_new (GdkMacosDisplay *display,
int width,
int height)
{
+ GdkFrameClock *frame_clock;
+ GdkMacosSurface *ret;
+
g_return_val_if_fail (GDK_IS_MACOS_DISPLAY (display), NULL);
+ if (parent != NULL)
+ frame_clock = g_object_ref (gdk_surface_get_frame_clock (parent));
+ else
+ frame_clock = _gdk_frame_clock_idle_new ();
+
switch (surface_type)
{
case GDK_SURFACE_TOPLEVEL:
- return _gdk_macos_toplevel_surface_new (display, parent, x, y, width, height);
+ ret = _gdk_macos_toplevel_surface_new (display, parent, frame_clock, x, y, width, height);
case GDK_SURFACE_POPUP:
- return _gdk_macos_popup_surface_new (display, parent, x, y, width, height);
+ ret = _gdk_macos_popup_surface_new (display, parent, frame_clock, x, y, width, height);
case GDK_SURFACE_TEMP:
- return _gdk_macos_drag_surface_new (display, parent, x, y, width, height);
+ ret = _gdk_macos_drag_surface_new (display, parent, frame_clock, x, y, width, height);
default:
- return NULL;
+ ret = NULL;
}
+
+ g_object_unref (frame_clock);
+
+ return g_steal_pointer (&ret);
}
void
diff --git a/gdk/macos/gdkmacostoplevelsurface-private.h b/gdk/macos/gdkmacostoplevelsurface-private.h
index 73b828e6dd..b62f0f2818 100644
--- a/gdk/macos/gdkmacostoplevelsurface-private.h
+++ b/gdk/macos/gdkmacostoplevelsurface-private.h
@@ -34,6 +34,7 @@ typedef struct _GdkMacosToplevelSurfaceClass GdkMacosToplevelSurfaceClass;
GType _gdk_macos_toplevel_surface_get_type (void);
GdkMacosSurface *_gdk_macos_toplevel_surface_new (GdkMacosDisplay *display,
GdkSurface *parent,
+ GdkFrameClock *frame_clock,
int x,
int y,
int width,
diff --git a/gdk/macos/gdkmacostoplevelsurface.c b/gdk/macos/gdkmacostoplevelsurface.c
index 479cf38112..e69e315202 100644
--- a/gdk/macos/gdkmacostoplevelsurface.c
+++ b/gdk/macos/gdkmacostoplevelsurface.c
@@ -22,6 +22,7 @@
#import "GdkMacosWindow.h"
#include "gdktoplevelprivate.h"
+
#include "gdkmacostoplevelsurface-private.h"
#include "gdkmacosutils-private.h"
@@ -252,15 +253,18 @@ _gdk_macos_toplevel_surface_init (GdkMacosToplevelSurface *self)
GdkMacosSurface *
_gdk_macos_toplevel_surface_new (GdkMacosDisplay *display,
GdkSurface *parent,
+ GdkFrameClock *frame_clock,
int x,
int y,
int width,
int height)
{
g_return_val_if_fail (GDK_IS_MACOS_DISPLAY (display), NULL);
+ g_return_val_if_fail (!frame_clock || GDK_IS_FRAME_CLOCK (frame_clock), NULL);
g_return_val_if_fail (!parent || GDK_IS_MACOS_SURFACE (parent), NULL);
return g_object_new (GDK_TYPE_MACOS_TOPLEVEL_SURFACE,
"display", display,
+ "frame-clock", frame_clock,
NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]