[gtk/present-toplevel-2: 33/34] more win32 build fixes
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/present-toplevel-2: 33/34] more win32 build fixes
- Date: Thu, 12 Mar 2020 19:18:20 +0000 (UTC)
commit 294a4b34fa35fad11dc56897d97dc2504cdc8349
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Mar 12 13:37:10 2020 -0400
more win32 build fixes
gdk/win32/gdkdrag-win32.c | 6 ++----
gdk/win32/gdkevents-win32.c | 2 +-
gdk/win32/gdkprivate-win32.h | 3 +++
gdk/win32/gdksurface-win32.c | 19 +++++++++++++------
4 files changed, 19 insertions(+), 11 deletions(-)
---
diff --git a/gdk/win32/gdkdrag-win32.c b/gdk/win32/gdkdrag-win32.c
index e4084e0b6b..e16ca9643e 100644
--- a/gdk/win32/gdkdrag-win32.c
+++ b/gdk/win32/gdkdrag-win32.c
@@ -738,7 +738,7 @@ move_drag_surface (GdkDrag *drag,
gdk_win32_surface_move (drag_win32->drag_surface,
x_root - drag_win32->hot_x,
y_root - drag_win32->hot_y);
- gdk_surface_raise (drag_win32->drag_surface);
+ gdk_win32_surface_raise (drag_win32->drag_surface);
}
static void
@@ -1701,8 +1701,6 @@ create_drag_surface (GdkDisplay *display)
surface = gdk_surface_new_temp (display, &(GdkRectangle) { 0, 0, 100, 100 });
- gdk_surface_set_type_hint (surface, GDK_SURFACE_TYPE_HINT_DND);
-
return surface;
}
@@ -2111,7 +2109,7 @@ gdk_drag_anim_timeout (gpointer data)
(drag->start_y - drag->util_data.last_y) * t -
drag->hot_y);
gdk_win32_surface_move (drag->drag_surface, x, y);
- gdk_surface_set_opacity (drag->drag_surface, 1.0 - f);
+ gdk_win32_surface_set_opacity (drag->drag_surface, 1.0 - f);
return G_SOURCE_CONTINUE;
}
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 36a53e94a2..ca8d7955e9 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -1278,7 +1278,7 @@ _gdk_win32_get_window_rect (GdkSurface *window,
point.y = client_rect.top;
/* top level windows need screen coords */
- if (gdk_toplevel_get_parent (GDK_TOPLEVEL (window)) == NULL)
+ if (GDK_IS_TOPLEVEL (window))
{
ClientToScreen (hwnd, &point);
point.x += _gdk_offset_x * impl->surface_scale;
diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h
index 0528c7b505..3f128cfcec 100644
--- a/gdk/win32/gdkprivate-win32.h
+++ b/gdk/win32/gdkprivate-win32.h
@@ -430,6 +430,9 @@ gboolean _gdk_win32_surface_lacks_wm_decorations (GdkSurface *window);
void gdk_win32_surface_show (GdkSurface *surface,
gboolean already_mapped);
+void gdk_win32_surface_raise (GdkSurface *surface);
+void gdk_win32_surface_set_opacity (GdkSurface *surface,
+ double opacity);
BOOL WINAPI GtkShowWindow (GdkSurface *window,
int cmd_show);
diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c
index da6b2eeb05..1525ffdd4d 100644
--- a/gdk/win32/gdksurface-win32.c
+++ b/gdk/win32/gdksurface-win32.c
@@ -1343,7 +1343,7 @@ gdk_win32_surface_layout_popup (GdkSurface *surface,
static void
show_popup (GdkSurface *surface)
{
- gdk_surface_raise (surface);
+ gdk_win32_surface_raise (surface);
gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_WITHDRAWN, 0);
_gdk_surface_update_viewable (surface);
show_window_internal (surface, FALSE, FALSE);
@@ -1386,7 +1386,7 @@ gdk_win32_surface_present_popup (GdkSurface *surface,
return GDK_SURFACE_IS_MAPPED (surface);
}
-static void
+void
gdk_win32_surface_raise (GdkSurface *window)
{
if (!GDK_SURFACE_DESTROYED (window))
@@ -1805,7 +1805,14 @@ gdk_win32_surface_get_geometry (GdkSurface *window,
API_CALL (GetClientRect, (GDK_SURFACE_HWND (window), &rect));
POINT pt;
- GdkSurface *parent = gdk_toplevel_get_parent (GDK_TOPLEVEL (window));
+
+ GdkSurface *parent;
+
+ if (GDK_IS_TOPLEVEL (window))
+ parent = NULL;
+ else if (GDK_IS_POPUP (window))
+ parent = gdk_popup_get_parent (GDK_POPUP (window));
+
pt.x = rect.left;
pt.y = rect.top;
@@ -4703,7 +4710,7 @@ gdk_win32_surface_set_modal_hint (GdkSurface *window,
if (modal)
{
_gdk_push_modal_window (window);
- gdk_surface_raise (window);
+ gdk_win32_surface_raise (window);
}
else
{
@@ -4757,9 +4764,9 @@ gdk_win32_surface_lookup_for_display (GdkDisplay *display,
return (GdkSurface*) gdk_win32_handle_table_lookup (anid);
}
-static void
+void
gdk_win32_surface_set_opacity (GdkSurface *window,
- gdouble opacity)
+ double opacity)
{
LONG exstyle;
typedef BOOL (WINAPI *PFN_SetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]