[gtk+] gdk: Deprecate static gravities
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gdk: Deprecate static gravities
- Date: Mon, 6 Oct 2014 00:43:20 +0000 (UTC)
commit 5e4672092a31320041b51c3ad69f0a40adec59bf
Author: Benjamin Otte <otte redhat com>
Date: Mon Oct 6 02:38:40 2014 +0200
gdk: Deprecate static gravities
... and remove all implementations. The API allows to not work "if the
server doesn't support it. So from now on, no server does!
gdk/broadway/gdkwindow-broadway.c | 8 ----
gdk/gdkinternals.h | 1 -
gdk/gdkoffscreenwindow.c | 8 ----
gdk/gdkwindow.c | 21 ++++------
gdk/gdkwindow.h | 2 +-
gdk/gdkwindowimpl.h | 3 -
gdk/quartz/gdkwindow-quartz.c | 13 ------
gdk/wayland/gdkwindow-wayland.c | 8 ----
gdk/win32/gdkwindow-win32.c | 10 -----
gdk/x11/gdkwindow-x11.c | 78 -------------------------------------
10 files changed, 9 insertions(+), 143 deletions(-)
---
diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c
index a0c19ee..24db20c 100644
--- a/gdk/broadway/gdkwindow-broadway.c
+++ b/gdk/broadway/gdkwindow-broadway.c
@@ -987,13 +987,6 @@ gdk_broadway_window_end_paint (GdkWindow *window)
impl->dirty = TRUE;
}
-static gboolean
-gdk_window_broadway_set_static_gravities (GdkWindow *window,
- gboolean use_static)
-{
- return TRUE;
-}
-
typedef struct _MoveResizeData MoveResizeData;
struct _MoveResizeData
@@ -1509,7 +1502,6 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
impl_class->get_device_state = gdk_window_broadway_get_device_state;
impl_class->shape_combine_region = gdk_window_broadway_shape_combine_region;
impl_class->input_shape_combine_region = gdk_window_broadway_input_shape_combine_region;
- impl_class->set_static_gravities = gdk_window_broadway_set_static_gravities;
impl_class->destroy = _gdk_broadway_window_destroy;
impl_class->destroy_foreign = gdk_broadway_window_destroy_foreign;
impl_class->get_shape = gdk_broadway_window_get_shape;
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index 5e98f96..bb6f831 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -219,7 +219,6 @@ struct _GdkWindow
guint8 alpha;
guint8 fullscreen_mode;
- guint guffaw_gravity : 1;
guint input_only : 1;
guint modal_hint : 1;
guint composited : 1;
diff --git a/gdk/gdkoffscreenwindow.c b/gdk/gdkoffscreenwindow.c
index e67a8b7..f9e8182 100644
--- a/gdk/gdkoffscreenwindow.c
+++ b/gdk/gdkoffscreenwindow.c
@@ -515,13 +515,6 @@ gdk_offscreen_window_input_shape_combine_region (GdkWindow *window,
{
}
-static gboolean
-gdk_offscreen_window_set_static_gravities (GdkWindow *window,
- gboolean use_static)
-{
- return TRUE;
-}
-
static void
gdk_offscreen_window_get_geometry (GdkWindow *window,
gint *x,
@@ -703,7 +696,6 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
impl_class->get_device_state = gdk_offscreen_window_get_device_state;
impl_class->shape_combine_region = gdk_offscreen_window_shape_combine_region;
impl_class->input_shape_combine_region = gdk_offscreen_window_input_shape_combine_region;
- impl_class->set_static_gravities = gdk_offscreen_window_set_static_gravities;
impl_class->queue_antiexpose = gdk_offscreen_window_queue_antiexpose;
impl_class->destroy = gdk_offscreen_window_destroy;
impl_class->destroy_foreign = NULL;
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 495ccd7..e65e7d9 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -6488,27 +6488,22 @@ gdk_window_merge_child_input_shapes (GdkWindow *window)
* @window: a #GdkWindow
* @use_static: %TRUE to turn on static gravity
*
- * Set the bit gravity of the given window to static, and flag it so
- * all children get static subwindow gravity. This is used if you are
- * implementing scary features that involve deep knowledge of the
- * windowing system. Don’t worry about it unless you have to.
+ * Used to set the bit gravity of the given window to static, and flag
+ * it so all children get static subwindow gravity. This is used if you
+ * are implementing scary features that involve deep knowledge of the
+ * windowing system. Don’t worry about it.
*
- * Returns: %TRUE if the server supports static gravity
+ * Returns: %FALSE
+ *
+ * Deprecated: 3.16: static gravities haven't worked on anything but X11
+ * for a long time.
*/
gboolean
gdk_window_set_static_gravities (GdkWindow *window,
gboolean use_static)
{
- GdkWindowImplClass *impl_class;
-
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
- if (gdk_window_has_impl (window))
- {
- impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
- return impl_class->set_static_gravities (window, use_static);
- }
-
return FALSE;
}
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index c7ec15c..3617c55 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -675,7 +675,7 @@ GdkWindowState gdk_window_get_state (GdkWindow *window);
/* Set static bit gravity on the parent, and static
* window gravity on all children.
*/
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16
gboolean gdk_window_set_static_gravities (GdkWindow *window,
gboolean use_static);
diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h
index 950db02..85ae134 100644
--- a/gdk/gdkwindowimpl.h
+++ b/gdk/gdkwindowimpl.h
@@ -121,9 +121,6 @@ struct _GdkWindowImplClass
gint offset_x,
gint offset_y);
- gboolean (* set_static_gravities) (GdkWindow *window,
- gboolean use_static);
-
/* Called before processing updates for a window. This gives the windowing
* layer a chance to save the region for later use in avoiding duplicate
* exposes.
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index d5a9923..0bb8ecf 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -2050,18 +2050,6 @@ gdk_quartz_window_set_accept_focus (GdkWindow *window,
window->accept_focus = accept_focus != FALSE;
}
-static gboolean
-gdk_window_quartz_set_static_gravities (GdkWindow *window,
- gboolean use_static)
-{
- if (GDK_WINDOW_DESTROYED (window) ||
- !WINDOW_IS_TOPLEVEL (window))
- return FALSE;
-
- /* FIXME: Implement */
- return FALSE;
-}
-
static void
gdk_quartz_window_set_focus_on_map (GdkWindow *window,
gboolean focus_on_map)
@@ -2954,7 +2942,6 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
impl_class->get_device_state = gdk_window_quartz_get_device_state;
impl_class->shape_combine_region = gdk_window_quartz_shape_combine_region;
impl_class->input_shape_combine_region = gdk_window_quartz_input_shape_combine_region;
- impl_class->set_static_gravities = gdk_window_quartz_set_static_gravities;
impl_class->destroy = gdk_quartz_window_destroy;
impl_class->destroy_foreign = gdk_quartz_window_destroy_foreign;
impl_class->get_shape = gdk_quartz_window_get_shape;
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 31f3116..5674259 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -1407,13 +1407,6 @@ gdk_window_wayland_input_shape_combine_region (GdkWindow *window,
gdk_wayland_window_sync_input_region (window);
}
-static gboolean
-gdk_window_wayland_set_static_gravities (GdkWindow *window,
- gboolean use_static)
-{
- return TRUE;
-}
-
static void
gdk_wayland_window_destroy (GdkWindow *window,
gboolean recursing,
@@ -2076,7 +2069,6 @@ _gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass)
impl_class->get_device_state = gdk_window_wayland_get_device_state;
impl_class->shape_combine_region = gdk_window_wayland_shape_combine_region;
impl_class->input_shape_combine_region = gdk_window_wayland_input_shape_combine_region;
- impl_class->set_static_gravities = gdk_window_wayland_set_static_gravities;
impl_class->destroy = gdk_wayland_window_destroy;
impl_class->destroy_foreign = gdk_window_wayland_destroy_foreign;
impl_class->get_shape = gdk_wayland_window_get_shape;
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 09b7d37..7b4bd79 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -2585,15 +2585,6 @@ _gdk_window_get_functions (GdkWindow *window,
return (functions_set != NULL);
}
-static gboolean
-gdk_win32_window_set_static_gravities (GdkWindow *window,
- gboolean use_static)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
-
- return !use_static;
-}
-
static void
gdk_win32_window_begin_resize_drag (GdkWindow *window,
GdkWindowEdge edge,
@@ -3394,7 +3385,6 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
impl_class->shape_combine_region = gdk_win32_window_shape_combine_region;
impl_class->input_shape_combine_region = gdk_win32_input_shape_combine_region;
- impl_class->set_static_gravities = gdk_win32_window_set_static_gravities;
impl_class->destroy = gdk_win32_window_destroy;
impl_class->destroy_foreign = gdk_win32_window_destroy_foreign;
impl_class->get_shape = gdk_win32_window_get_shape;
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index ad61618..3d6ff76 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -99,8 +99,6 @@ const gint _gdk_x11_event_mask_table_size = G_N_ELEMENTS (_gdk_x11_event_mask_ta
/* Forward declarations */
static void gdk_x11_window_apply_fullscreen_mode (GdkWindow *window);
-static void gdk_window_set_static_win_gravity (GdkWindow *window,
- gboolean on);
static gboolean gdk_window_icon_name_set (GdkWindow *window);
static void set_wm_name (GdkDisplay *display,
Window xwindow,
@@ -1043,12 +1041,6 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
impl->override_redirect = xattributes.override_redirect;
- if (window->parent->guffaw_gravity)
- {
- xattributes.win_gravity = StaticGravity;
- xattributes_mask |= CWWinGravity;
- }
-
/* Sanity checks */
switch (window->window_type)
{
@@ -1070,13 +1062,6 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
xattributes.border_pixel = BlackPixel (xdisplay, x11_screen->screen_num);
xattributes_mask |= CWBorderPixel | CWBackPixel;
- if (window->guffaw_gravity)
- xattributes.bit_gravity = StaticGravity;
- else
- xattributes.bit_gravity = NorthWestGravity;
-
- xattributes_mask |= CWBitGravity;
-
xattributes.colormap = _gdk_visual_get_x11_colormap (window->visual);
xattributes_mask |= CWColormap;
@@ -4575,68 +4560,6 @@ gdk_x11_window_get_input_shape (GdkWindow *window)
return NULL;
}
-static void
-gdk_window_set_static_bit_gravity (GdkWindow *window,
- gboolean on)
-{
- XSetWindowAttributes xattributes;
- guint xattributes_mask = 0;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- if (window->input_only)
- return;
-
- xattributes.bit_gravity = StaticGravity;
- xattributes_mask |= CWBitGravity;
- xattributes.bit_gravity = on ? StaticGravity : ForgetGravity;
- XChangeWindowAttributes (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
- CWBitGravity, &xattributes);
-}
-
-static void
-gdk_window_set_static_win_gravity (GdkWindow *window,
- gboolean on)
-{
- XSetWindowAttributes xattributes;
-
- g_return_if_fail (GDK_IS_WINDOW (window));
-
- xattributes.win_gravity = on ? StaticGravity : NorthWestGravity;
-
- XChangeWindowAttributes (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
- CWWinGravity, &xattributes);
-}
-
-static gboolean
-gdk_window_x11_set_static_gravities (GdkWindow *window,
- gboolean use_static)
-{
- GList *tmp_list;
-
- if (!use_static == !window->guffaw_gravity)
- return TRUE;
-
- window->guffaw_gravity = use_static;
-
- if (!GDK_WINDOW_DESTROYED (window))
- {
- gdk_window_set_static_bit_gravity (window, use_static);
-
- tmp_list = window->children;
- while (tmp_list)
- {
- gdk_window_set_static_win_gravity (tmp_list->data, use_static);
-
- tmp_list = tmp_list->next;
- }
- }
-
- return TRUE;
-}
-
/* From the WM spec */
#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0
#define _NET_WM_MOVERESIZE_SIZE_TOP 1
@@ -5747,7 +5670,6 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
impl_class->get_device_state = gdk_window_x11_get_device_state;
impl_class->shape_combine_region = gdk_window_x11_shape_combine_region;
impl_class->input_shape_combine_region = gdk_window_x11_input_shape_combine_region;
- impl_class->set_static_gravities = gdk_window_x11_set_static_gravities;
impl_class->queue_antiexpose = _gdk_x11_window_queue_antiexpose;
impl_class->destroy = gdk_x11_window_destroy;
impl_class->destroy_foreign = gdk_x11_window_destroy_foreign;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]