API: screen: Remove gdk_screen_get_active_window()

... and gdk_screen_get_window_stack().

Those functions were originally added in
5afb4f0f11 but do not seem to be used as
they are not implemented anywhere but in X.

As GDK is not meant to fulfill window management functionality I'm going
to remove these functions without replacements.
This commit is contained in:
Benjamin Otte 2016-09-28 02:16:53 +02:00
parent 26f9b584be
commit 6b9e481e38
10 changed files with 0 additions and 240 deletions

View File

@ -223,8 +223,6 @@ gdk_screen_get_font_options
gdk_screen_set_font_options
gdk_screen_get_resolution
gdk_screen_set_resolution
gdk_screen_get_active_window
gdk_screen_get_window_stack
<SUBSECTION Standard>
GDK_SCREEN

View File

@ -160,18 +160,6 @@ gdk_broadway_screen_make_display_name (GdkScreen *screen)
return g_strdup ("browser");
}
static GdkWindow *
gdk_broadway_screen_get_active_window (GdkScreen *screen)
{
return NULL;
}
static GList *
gdk_broadway_screen_get_window_stack (GdkScreen *screen)
{
return NULL;
}
static void
gdk_broadway_screen_broadcast_client_message (GdkScreen *screen,
GdkEvent *event)
@ -204,8 +192,6 @@ gdk_broadway_screen_class_init (GdkBroadwayScreenClass *klass)
screen_class->get_root_window = gdk_broadway_screen_get_root_window;
screen_class->is_composited = gdk_broadway_screen_is_composited;
screen_class->make_display_name = gdk_broadway_screen_make_display_name;
screen_class->get_active_window = gdk_broadway_screen_get_active_window;
screen_class->get_window_stack = gdk_broadway_screen_get_window_stack;
screen_class->broadcast_client_message = gdk_broadway_screen_broadcast_client_message;
screen_class->get_setting = gdk_broadway_screen_get_setting;
screen_class->get_rgba_visual = gdk_broadway_screen_get_rgba_visual;

View File

@ -502,71 +502,6 @@ gdk_screen_make_display_name (GdkScreen *screen)
return GDK_SCREEN_GET_CLASS (screen)->make_display_name (screen);
}
/**
* gdk_screen_get_active_window:
* @screen: a #GdkScreen
*
* Returns the screens currently active window.
*
* On X11, this is done by inspecting the _NET_ACTIVE_WINDOW property
* on the root window, as described in the
* [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec).
* If there is no currently currently active
* window, or the window manager does not support the
* _NET_ACTIVE_WINDOW hint, this function returns %NULL.
*
* On other platforms, this function may return %NULL, depending on whether
* it is implementable on that platform.
*
* The returned window should be unrefed using g_object_unref() when
* no longer needed.
*
* Returns: (nullable) (transfer full): the currently active window,
* or %NULL.
*
* Since: 2.10
**/
GdkWindow *
gdk_screen_get_active_window (GdkScreen *screen)
{
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
return GDK_SCREEN_GET_CLASS (screen)->get_active_window (screen);
}
/**
* gdk_screen_get_window_stack:
* @screen: a #GdkScreen
*
* Returns a #GList of #GdkWindows representing the current
* window stack.
*
* On X11, this is done by inspecting the _NET_CLIENT_LIST_STACKING
* property on the root window, as described in the
* [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec).
* If the window manager does not support the
* _NET_CLIENT_LIST_STACKING hint, this function returns %NULL.
*
* On other platforms, this function may return %NULL, depending on whether
* it is implementable on that platform.
*
* The returned list is newly allocated and owns references to the
* windows it contains, so it should be freed using g_list_free() and
* its windows unrefed using g_object_unref() when no longer needed.
*
* Returns: (nullable) (transfer full) (element-type GdkWindow): a
* list of #GdkWindows for the current window stack, or %NULL.
*
* Since: 2.10
**/
GList *
gdk_screen_get_window_stack (GdkScreen *screen)
{
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
return GDK_SCREEN_GET_CLASS (screen)->get_window_stack (screen);
}
/**
* gdk_screen_get_setting:
* @screen: the #GdkScreen where the setting is located

View File

@ -80,11 +80,6 @@ void gdk_screen_set_resolution (GdkScreen *screen,
GDK_AVAILABLE_IN_ALL
gdouble gdk_screen_get_resolution (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GdkWindow *gdk_screen_get_active_window (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GList *gdk_screen_get_window_stack (GdkScreen *screen);
G_END_DECLS
#endif /* __GDK_SCREEN_H__ */

View File

@ -64,8 +64,6 @@ struct _GdkScreenClass
GdkVisual * (* get_rgba_visual) (GdkScreen *screen);
gboolean (* is_composited) (GdkScreen *screen);
gchar * (* make_display_name) (GdkScreen *screen);
GdkWindow * (* get_active_window) (GdkScreen *screen);
GList * (* get_window_stack) (GdkScreen *screen);
void (* broadcast_client_message) (GdkScreen *screen,
GdkEvent *event);
gboolean (* get_setting) (GdkScreen *screen,

View File

@ -426,20 +426,6 @@ gdk_mir_screen_make_display_name (GdkScreen *screen)
return NULL; // FIXME
}
static GdkWindow *
gdk_mir_screen_get_active_window (GdkScreen *screen)
{
//g_printerr ("gdk_mir_screen_get_active_window\n");
return NULL; // FIXME
}
static GList *
gdk_mir_screen_get_window_stack (GdkScreen *screen)
{
//g_printerr ("gdk_mir_screen_get_window_stack\n");
return NULL; // FIXME
}
static void
gdk_mir_screen_broadcast_client_message (GdkScreen *screen,
GdkEvent *event)
@ -819,8 +805,6 @@ gdk_mir_screen_class_init (GdkMirScreenClass *klass)
screen_class->get_rgba_visual = gdk_mir_screen_get_rgba_visual;
screen_class->is_composited = gdk_mir_screen_is_composited;
screen_class->make_display_name = gdk_mir_screen_make_display_name;
screen_class->get_active_window = gdk_mir_screen_get_active_window;
screen_class->get_window_stack = gdk_mir_screen_get_window_stack;
screen_class->broadcast_client_message = gdk_mir_screen_broadcast_client_message;
screen_class->get_setting = gdk_mir_screen_get_setting;
screen_class->visual_get_best_depth = gdk_mir_screen_visual_get_best_depth;

View File

@ -458,18 +458,6 @@ gdk_quartz_screen_make_display_name (GdkScreen *screen)
return g_strdup (gdk_display_get_name (_gdk_display));
}
static GdkWindow *
gdk_quartz_screen_get_active_window (GdkScreen *screen)
{
return NULL;
}
static GList *
gdk_quartz_screen_get_window_stack (GdkScreen *screen)
{
return NULL;
}
static gboolean
gdk_quartz_screen_is_composited (GdkScreen *screen)
{
@ -500,8 +488,6 @@ gdk_quartz_screen_class_init (GdkQuartzScreenClass *klass)
screen_class->get_monitor_workarea = gdk_quartz_screen_get_monitor_workarea;
screen_class->is_composited = gdk_quartz_screen_is_composited;
screen_class->make_display_name = gdk_quartz_screen_make_display_name;
screen_class->get_active_window = gdk_quartz_screen_get_active_window;
screen_class->get_window_stack = gdk_quartz_screen_get_window_stack;
screen_class->broadcast_client_message = _gdk_quartz_screen_broadcast_client_message;
screen_class->get_setting = _gdk_quartz_screen_get_setting;
screen_class->get_rgba_visual = _gdk_quartz_screen_get_rgba_visual;

View File

@ -141,18 +141,6 @@ gdk_wayland_screen_make_display_name (GdkScreen *screen)
return g_strdup (gdk_display_get_name (GDK_WAYLAND_SCREEN (screen)->display));
}
static GdkWindow *
gdk_wayland_screen_get_active_window (GdkScreen *screen)
{
return NULL;
}
static GList *
gdk_wayland_screen_get_window_stack (GdkScreen *screen)
{
return NULL;
}
static void
gdk_wayland_screen_broadcast_client_message (GdkScreen *screen,
GdkEvent *event)
@ -819,8 +807,6 @@ _gdk_wayland_screen_class_init (GdkWaylandScreenClass *klass)
screen_class->get_rgba_visual = gdk_wayland_screen_get_rgba_visual;
screen_class->is_composited = gdk_wayland_screen_is_composited;
screen_class->make_display_name = gdk_wayland_screen_make_display_name;
screen_class->get_active_window = gdk_wayland_screen_get_active_window;
screen_class->get_window_stack = gdk_wayland_screen_get_window_stack;
screen_class->broadcast_client_message = gdk_wayland_screen_broadcast_client_message;
screen_class->get_setting = gdk_wayland_screen_get_setting;
screen_class->visual_get_best_depth = gdk_wayland_screen_visual_get_best_depth;

View File

@ -392,22 +392,6 @@ gdk_win32_screen_make_display_name (GdkScreen *screen)
return g_strdup (gdk_display_get_name (_gdk_display));
}
static GdkWindow *
gdk_win32_screen_get_active_window (GdkScreen *screen)
{
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
return NULL;
}
static GList *
gdk_win32_screen_get_window_stack (GdkScreen *screen)
{
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
return NULL;
}
static gboolean
gdk_win32_screen_is_composited (GdkScreen *screen)
{
@ -544,8 +528,6 @@ gdk_win32_screen_class_init (GdkWin32ScreenClass *klass)
screen_class->get_root_window = gdk_win32_screen_get_root_window;
screen_class->is_composited = gdk_win32_screen_is_composited;
screen_class->make_display_name = gdk_win32_screen_make_display_name;
screen_class->get_active_window = gdk_win32_screen_get_active_window;
screen_class->get_window_stack = gdk_win32_screen_get_window_stack;
screen_class->get_setting = _gdk_win32_screen_get_setting;
screen_class->get_system_visual = gdk_win32_screen_get_system_visual;
screen_class->get_rgba_visual = gdk_win32_screen_get_rgba_visual;

View File

@ -1081,94 +1081,6 @@ gdk_x11_screen_make_display_name (GdkScreen *screen)
gdk_x11_screen_get_screen_number (screen));
}
static GdkWindow *
gdk_x11_screen_get_active_window (GdkScreen *screen)
{
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
GdkWindow *ret = NULL;
Atom type_return;
gint format_return;
gulong nitems_return;
gulong bytes_after_return;
guchar *data = NULL;
if (!gdk_x11_screen_supports_net_wm_hint (screen,
gdk_atom_intern_static_string ("_NET_ACTIVE_WINDOW")))
return NULL;
if (XGetWindowProperty (x11_screen->xdisplay, x11_screen->xroot_window,
gdk_x11_get_xatom_by_name_for_display (x11_screen->display,
"_NET_ACTIVE_WINDOW"),
0, 1, False, XA_WINDOW, &type_return,
&format_return, &nitems_return,
&bytes_after_return, &data)
== Success)
{
if ((type_return == XA_WINDOW) && (format_return == 32) && (data))
{
Window window = *(Window *) data;
if (window != None)
{
ret = gdk_x11_window_foreign_new_for_display (x11_screen->display,
window);
}
}
}
if (data)
XFree (data);
return ret;
}
static GList *
gdk_x11_screen_get_window_stack (GdkScreen *screen)
{
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
GList *ret = NULL;
Atom type_return;
gint format_return;
gulong nitems_return;
gulong bytes_after_return;
guchar *data = NULL;
if (!gdk_x11_screen_supports_net_wm_hint (screen,
gdk_atom_intern_static_string ("_NET_CLIENT_LIST_STACKING")))
return NULL;
if (XGetWindowProperty (x11_screen->xdisplay, x11_screen->xroot_window,
gdk_x11_get_xatom_by_name_for_display (x11_screen->display,
"_NET_CLIENT_LIST_STACKING"),
0, G_MAXLONG, False, XA_WINDOW, &type_return,
&format_return, &nitems_return,
&bytes_after_return, &data)
== Success)
{
if ((type_return == XA_WINDOW) && (format_return == 32) &&
(data) && (nitems_return > 0))
{
gulong *stack = (gulong *) data;
GdkWindow *win;
int i;
for (i = 0; i < nitems_return; i++)
{
win = gdk_x11_window_foreign_new_for_display (x11_screen->display,
(Window)stack[i]);
if (win != NULL)
ret = g_list_append (ret, win);
}
}
}
if (data)
XFree (data);
return ret;
}
static gboolean
gdk_x11_screen_get_setting (GdkScreen *screen,
const gchar *name,
@ -1474,8 +1386,6 @@ gdk_x11_screen_class_init (GdkX11ScreenClass *klass)
screen_class->get_rgba_visual = gdk_x11_screen_get_rgba_visual;
screen_class->is_composited = gdk_x11_screen_is_composited;
screen_class->make_display_name = gdk_x11_screen_make_display_name;
screen_class->get_active_window = gdk_x11_screen_get_active_window;
screen_class->get_window_stack = gdk_x11_screen_get_window_stack;
screen_class->get_setting = gdk_x11_screen_get_setting;
screen_class->visual_get_best_depth = _gdk_x11_screen_visual_get_best_depth;
screen_class->visual_get_best_type = _gdk_x11_screen_visual_get_best_type;