[gtk+] gdkwindow: Remove GdkWindowAttr.type_hint
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gdkwindow: Remove GdkWindowAttr.type_hint
- Date: Mon, 7 Nov 2016 01:05:21 +0000 (UTC)
commit 7a6cab14eb7bc6340a85447a8eb1d90138062f06
Author: Benjamin Otte <otte redhat com>
Date: Sun Nov 6 16:22:21 2016 +0100
gdkwindow: Remove GdkWindowAttr.type_hint
Instead, let the callers call gdk_window_set_type_hint(). Which is
surprsingly what every backend did.
gdk/gdkwindow.h | 4 +---
gdk/mir/gdkmirwindowimpl.c | 3 ---
gdk/quartz/gdkwindow-quartz.c | 3 ---
gdk/wayland/gdkdnd-wayland.c | 10 +++++++---
gdk/wayland/gdkwindow-wayland.c | 3 ---
gdk/win32/gdkwindow-win32.c | 8 ++------
gdk/x11/gdkdnd-x11.c | 10 +++++++---
gdk/x11/gdkwindow-x11.c | 3 ---
gtk/gtkwindow.c | 6 ++----
9 files changed, 19 insertions(+), 31 deletions(-)
---
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index 8a62ba6..f53338e 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -87,7 +87,6 @@ typedef enum
* GdkWindowAttributesType:
* @GDK_WA_X: Honor the X coordinate field
* @GDK_WA_Y: Honor the Y coordinate field
- * @GDK_WA_TYPE_HINT: Honor the type_hint field
*
* Used to indicate which fields in the #GdkWindowAttr struct should be honored.
* For example, if you filled in the “x” and “y” fields of #GdkWindowAttr,
@@ -99,8 +98,7 @@ typedef enum
typedef enum
{
GDK_WA_X = 1 << 1,
- GDK_WA_Y = 1 << 2,
- GDK_WA_TYPE_HINT = 1 << 3
+ GDK_WA_Y = 1 << 2
} GdkWindowAttributesType;
/* Size restriction enumeration.
diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c
index 39f23d9..3ed0466 100644
--- a/gdk/mir/gdkmirwindowimpl.c
+++ b/gdk/mir/gdkmirwindowimpl.c
@@ -174,9 +174,6 @@ _gdk_mir_window_impl_new (GdkDisplay *display, GdkWindow *window, GdkWindowAttr
impl->title = g_strdup (get_default_title ());
- if (attributes && attributes_mask & GDK_WA_TYPE_HINT)
- impl->type_hint = attributes->type_hint;
-
impl->pending_spec_update = TRUE;
return (GdkWindowImpl *) impl;
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 144eafd..27babc4 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -897,9 +897,6 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
}
GDK_QUARTZ_RELEASE_POOL;
-
- if (attributes_mask & GDK_WA_TYPE_HINT)
- gdk_window_set_type_hint (window, attributes->type_hint);
}
void
diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c
index 817b72e..ca5ec77 100644
--- a/gdk/wayland/gdkdnd-wayland.c
+++ b/gdk/wayland/gdkdnd-wayland.c
@@ -501,17 +501,21 @@ static GdkWindow *
create_dnd_window (GdkScreen *screen)
{
GdkWindowAttr attrs;
+ GdkWindow *window;
guint mask;
attrs.x = attrs.y = 0;
attrs.width = attrs.height = 100;
attrs.wclass = GDK_INPUT_OUTPUT;
attrs.window_type = GDK_WINDOW_TEMP;
- attrs.type_hint = GDK_WINDOW_TYPE_HINT_DND;
- mask = GDK_WA_X | GDK_WA_Y | GDK_WA_TYPE_HINT;
+ mask = GDK_WA_X | GDK_WA_Y;
+
+ window = gdk_window_new (gdk_screen_get_root_window (screen), &attrs, mask);
- return gdk_window_new (gdk_screen_get_root_window (screen), &attrs, mask);
+ gdk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DND);
+
+ return window;
}
GdkDragContext *
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 0b4ee60..837fde9 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -702,9 +702,6 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
gdk_wayland_window_create_surface (window);
- if (attributes_mask & GDK_WA_TYPE_HINT)
- gdk_window_set_type_hint (window, attributes->type_hint);
-
frame_clock = gdk_window_get_frame_clock (window);
g_signal_connect (frame_clock, "before-paint",
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 8462d5e..4b51e91 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -732,9 +732,8 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
remaining_mask &= ~GDK_WA_Y;
}
- if ((remaining_mask & ~(GDK_WA_TYPE_HINT)) != 0)
- g_warning ("_gdk_window_impl_new: uexpected attribute 0x%X",
- remaining_mask & ~(GDK_WA_TYPE_HINT));
+ if (remaining_mask != 0)
+ g_warning ("_gdk_window_impl_new: uexpected attribute 0x%X", remaining_mask);
hparent = GDK_WINDOW_HWND (real_parent);
@@ -851,9 +850,6 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
impl->native_event_mask = GDK_STRUCTURE_MASK | event_mask;
- if (attributes_mask & GDK_WA_TYPE_HINT)
- gdk_window_set_type_hint (window, attributes->type_hint);
-
if (impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY)
dwExStyle |= WS_EX_TOOLWINDOW;
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index 596a4de..f4cdcc3 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -1994,17 +1994,21 @@ static GdkWindow *
create_drag_window (GdkScreen *screen)
{
GdkWindowAttr attrs = { 0 };
+ GdkWindow *window;
guint mask;
attrs.x = attrs.y = 0;
attrs.width = attrs.height = 100;
attrs.wclass = GDK_INPUT_OUTPUT;
attrs.window_type = GDK_WINDOW_TEMP;
- attrs.type_hint = GDK_WINDOW_TYPE_HINT_DND;
- mask = GDK_WA_X | GDK_WA_Y | GDK_WA_TYPE_HINT;
+ mask = GDK_WA_X | GDK_WA_Y;
+
+ window = gdk_window_new (gdk_screen_get_root_window (screen), &attrs, mask);
- return gdk_window_new (gdk_screen_get_root_window (screen), &attrs, mask);
+ gdk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DND);
+
+ return window;
}
GdkDragContext *
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index f003dc3..8d226dc 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -1032,9 +1032,6 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
break;
}
- if (attributes_mask & GDK_WA_TYPE_HINT)
- gdk_window_set_type_hint (window, attributes->type_hint);
-
gdk_x11_event_source_select_events ((GdkEventSource *) display_x11->event_source,
GDK_WINDOW_XID (window), event_mask,
StructureNotifyMask | PropertyChangeMask);
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 4cbca1e..58c66c3 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6986,10 +6986,6 @@ gtk_window_realize (GtkWidget *widget)
if (priv->decorated && priv->client_decorated)
attributes.event_mask |= GDK_POINTER_MOTION_MASK;
- attributes.type_hint = priv->type_hint;
-
- attributes_mask |= GDK_WA_TYPE_HINT;
-
gdk_window = gdk_window_new (parent_window, &attributes, attributes_mask);
}
@@ -7027,6 +7023,8 @@ gtk_window_realize (GtkWidget *widget)
gdk_window_set_transient_for (gdk_window,
_gtk_widget_get_window (GTK_WIDGET (priv->transient_parent)));
+ gdk_window_set_type_hint (gdk_window, priv->type_hint);
+
if (priv->title)
gdk_window_set_title (gdk_window, priv->title);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]