summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2020-08-05 10:43:11 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2020-08-05 16:23:14 +0800
commit46a8a3fe31aa539f4d557b6501a84149d9ae9b28 (patch)
tree2710ddcfae2c4352c8c37188255a113774c769be
parentc6ada2a329fdb748e03a9ddb4c15bce77f5c1c42 (diff)
downloadgtk+-46a8a3fe31aa539f4d557b6501a84149d9ae9b28.tar.gz
gdk[cairo|gl]context-win32.c: Use gdk_win32_surface_handle_queued_move_resize()
Use the shared function that was added in the previous commit, to simplify things. Also make gdk_win32_surface_get_queued_window_rect() and gdk_win32_surface_apply_queued_move_resize() back into static functions, since they are now used only by the code in gdksurface-win32.c
-rw-r--r--gdk/win32/gdkcairocontext-win32.c18
-rw-r--r--gdk/win32/gdkglcontext-win32.c19
-rw-r--r--gdk/win32/gdksurface-win32.c4
-rw-r--r--gdk/win32/gdksurface-win32.h9
4 files changed, 4 insertions, 46 deletions
diff --git a/gdk/win32/gdkcairocontext-win32.c b/gdk/win32/gdkcairocontext-win32.c
index fa3b834fae..27f8baa36f 100644
--- a/gdk/win32/gdkcairocontext-win32.c
+++ b/gdk/win32/gdkcairocontext-win32.c
@@ -107,23 +107,7 @@ gdk_win32_cairo_context_begin_frame (GdkDrawContext *draw_context,
impl = GDK_WIN32_SURFACE (surface);
scale = gdk_surface_get_scale_factor (surface);
- self->layered = impl->layered;
-
- gdk_win32_surface_get_queued_window_rect (surface, scale, &queued_window_rect);
-
- /* Apply queued resizes for non-double-buffered and non-layered windows
- * before painting them (we paint on the window DC directly,
- * it must have the right size).
- * Due to some poorly-undetstood issue delayed
- * resizing of double-buffered windows can produce weird
- * artefacts, so these are also resized before we paint.
- */
- if (impl->drag_move_resize_context.native_move_resize_pending &&
- !self->layered)
- {
- impl->drag_move_resize_context.native_move_resize_pending = FALSE;
- gdk_win32_surface_apply_queued_move_resize (surface, queued_window_rect);
- }
+ queued_window_rect = gdk_win32_surface_handle_queued_move_resize (draw_context);
width = queued_window_rect.right - queued_window_rect.left;
height = queued_window_rect.bottom - queued_window_rect.top;
diff --git a/gdk/win32/gdkglcontext-win32.c b/gdk/win32/gdkglcontext-win32.c
index a500ffcddc..ed2165d3e2 100644
--- a/gdk/win32/gdkglcontext-win32.c
+++ b/gdk/win32/gdkglcontext-win32.c
@@ -243,27 +243,10 @@ gdk_win32_gl_context_begin_frame (GdkDrawContext *draw_context,
{
GdkGLContext *context = GDK_GL_CONTEXT (draw_context);
GdkSurface *surface;
- GdkWin32Surface *impl;
- RECT queued_window_rect;
surface = gdk_gl_context_get_surface (context);
- impl = GDK_WIN32_SURFACE (surface);
- gdk_win32_surface_get_queued_window_rect (surface,
- gdk_surface_get_scale_factor (surface),
- &queued_window_rect);
-
- /* Apply queued resizes GL windows before painting them
- * (we paint on the window DC directly, it must have the right size).
- * Due to some poorly-understood issue delayed
- * resizing of double-buffered windows can produce weird
- * artefacts, so these are also resized before we paint.
- */
- if (impl->drag_move_resize_context.native_move_resize_pending)
- {
- impl->drag_move_resize_context.native_move_resize_pending = FALSE;
- gdk_win32_surface_apply_queued_move_resize (surface, queued_window_rect);
- }
+ gdk_win32_surface_handle_queued_move_resize (draw_context);
GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_parent_class)->begin_frame (draw_context, update_area);
if (gdk_gl_context_get_shared_context (context))
diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c
index 9aa33b96ac..bcee5ce242 100644
--- a/gdk/win32/gdksurface-win32.c
+++ b/gdk/win32/gdksurface-win32.c
@@ -5103,7 +5103,7 @@ _gdk_win32_surface_get_egl_surface (GdkSurface *surface,
}
#endif
-void
+static void
gdk_win32_surface_get_queued_window_rect (GdkSurface *surface,
int scale,
RECT *return_window_rect)
@@ -5125,7 +5125,7 @@ gdk_win32_surface_get_queued_window_rect (GdkSurface *surface,
*return_window_rect = window_rect;
}
-void
+static void
gdk_win32_surface_apply_queued_move_resize (GdkSurface *surface,
RECT window_rect)
{
diff --git a/gdk/win32/gdksurface-win32.h b/gdk/win32/gdksurface-win32.h
index 7fb35ed764..1f54b7b070 100644
--- a/gdk/win32/gdksurface-win32.h
+++ b/gdk/win32/gdksurface-win32.h
@@ -396,15 +396,6 @@ void gdk_win32_surface_move_resize (GdkSurface *window,
RECT
gdk_win32_surface_handle_queued_move_resize (GdkDrawContext *draw_context);
-void
-gdk_win32_surface_get_queued_window_rect (GdkSurface *surface,
- int scale,
- RECT *return_window_rect);
-
-void
-gdk_win32_surface_apply_queued_move_resize (GdkSurface *surface,
- RECT window_rect);
-
#ifdef GDK_WIN32_ENABLE_EGL
EGLSurface _gdk_win32_surface_get_egl_surface (GdkSurface *surface,
EGLConfig config,