mirror of
https://github.com/brl/mutter.git
synced 2025-02-14 20:34:10 +00:00
Export functions to iterate over window transients
https://bugzilla.gnome.org/show_bug.cgi?id=616050
This commit is contained in:
parent
49940877d1
commit
609aae684f
@ -46,9 +46,6 @@
|
|||||||
|
|
||||||
typedef struct _MetaWindowQueue MetaWindowQueue;
|
typedef struct _MetaWindowQueue MetaWindowQueue;
|
||||||
|
|
||||||
typedef gboolean (*MetaWindowForeachFunc) (MetaWindow *window,
|
|
||||||
void *data);
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
META_CLIENT_TYPE_UNKNOWN = 0,
|
META_CLIENT_TYPE_UNKNOWN = 0,
|
||||||
META_CLIENT_TYPE_APPLICATION = 1,
|
META_CLIENT_TYPE_APPLICATION = 1,
|
||||||
@ -580,12 +577,6 @@ void meta_window_refresh_resize_popup (MetaWindow *window);
|
|||||||
|
|
||||||
void meta_window_free_delete_dialog (MetaWindow *window);
|
void meta_window_free_delete_dialog (MetaWindow *window);
|
||||||
|
|
||||||
void meta_window_foreach_transient (MetaWindow *window,
|
|
||||||
MetaWindowForeachFunc func,
|
|
||||||
void *data);
|
|
||||||
void meta_window_foreach_ancestor (MetaWindow *window,
|
|
||||||
MetaWindowForeachFunc func,
|
|
||||||
void *data);
|
|
||||||
|
|
||||||
void meta_window_begin_grab_op (MetaWindow *window,
|
void meta_window_begin_grab_op (MetaWindow *window,
|
||||||
MetaGrabOp op,
|
MetaGrabOp op,
|
||||||
|
@ -8247,10 +8247,22 @@ meta_window_refresh_resize_popup (MetaWindow *window)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* meta_window_foreach_transient:
|
||||||
|
* @window: a #MetaWindow
|
||||||
|
* @func: (scope call): Called for each window which is a transient of @window (transitively)
|
||||||
|
* @user_data: (closure): User data
|
||||||
|
*
|
||||||
|
* Call @func for every window which is either transient for @window, or is
|
||||||
|
* a transient of a window which is in turn transient for @window.
|
||||||
|
* The order of window enumeration is not defined.
|
||||||
|
*
|
||||||
|
* Iteration will stop if @func at any point returns %FALSE.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
meta_window_foreach_transient (MetaWindow *window,
|
meta_window_foreach_transient (MetaWindow *window,
|
||||||
MetaWindowForeachFunc func,
|
MetaWindowForeachFunc func,
|
||||||
void *data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
GSList *windows;
|
GSList *windows;
|
||||||
GSList *tmp;
|
GSList *tmp;
|
||||||
@ -8264,7 +8276,7 @@ meta_window_foreach_transient (MetaWindow *window,
|
|||||||
|
|
||||||
if (meta_window_is_ancestor_of_transient (window, transient))
|
if (meta_window_is_ancestor_of_transient (window, transient))
|
||||||
{
|
{
|
||||||
if (!(* func) (transient, data))
|
if (!(* func) (transient, user_data))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8274,10 +8286,19 @@ meta_window_foreach_transient (MetaWindow *window,
|
|||||||
g_slist_free (windows);
|
g_slist_free (windows);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* meta_window_foreach_ancestor:
|
||||||
|
* @window: a #MetaWindow
|
||||||
|
* @func: (scope call): Called for each window which is a transient parent of @window
|
||||||
|
* @user_data: (closure): User data
|
||||||
|
*
|
||||||
|
* If @window is transient, call @func with the window for which it's transient,
|
||||||
|
* repeatedly until either we find a non-transient window, or @func returns %FALSE.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
meta_window_foreach_ancestor (MetaWindow *window,
|
meta_window_foreach_ancestor (MetaWindow *window,
|
||||||
MetaWindowForeachFunc func,
|
MetaWindowForeachFunc func,
|
||||||
void *data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
MetaWindow *w;
|
MetaWindow *w;
|
||||||
MetaWindow *tortoise;
|
MetaWindow *tortoise;
|
||||||
@ -8295,7 +8316,7 @@ meta_window_foreach_ancestor (MetaWindow *window,
|
|||||||
if (w == NULL || w == tortoise)
|
if (w == NULL || w == tortoise)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!(* func) (w, data))
|
if (!(* func) (w, user_data))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (w->xtransient_for == None ||
|
if (w->xtransient_for == None ||
|
||||||
@ -8307,7 +8328,7 @@ meta_window_foreach_ancestor (MetaWindow *window,
|
|||||||
if (w == NULL || w == tortoise)
|
if (w == NULL || w == tortoise)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!(* func) (w, data))
|
if (!(* func) (w, user_data))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
tortoise = meta_display_lookup_x_window (tortoise->display,
|
tortoise = meta_display_lookup_x_window (tortoise->display,
|
||||||
|
@ -108,6 +108,17 @@ MetaStackLayer meta_window_get_layer (MetaWindow *window);
|
|||||||
MetaWindow* meta_window_find_root_ancestor (MetaWindow *window);
|
MetaWindow* meta_window_find_root_ancestor (MetaWindow *window);
|
||||||
gboolean meta_window_is_ancestor_of_transient (MetaWindow *window,
|
gboolean meta_window_is_ancestor_of_transient (MetaWindow *window,
|
||||||
MetaWindow *transient);
|
MetaWindow *transient);
|
||||||
|
|
||||||
|
typedef gboolean (*MetaWindowForeachFunc) (MetaWindow *window,
|
||||||
|
void *data);
|
||||||
|
|
||||||
|
void meta_window_foreach_transient (MetaWindow *window,
|
||||||
|
MetaWindowForeachFunc func,
|
||||||
|
void *user_data);
|
||||||
|
void meta_window_foreach_ancestor (MetaWindow *window,
|
||||||
|
MetaWindowForeachFunc func,
|
||||||
|
void *user_data);
|
||||||
|
|
||||||
gboolean meta_window_is_mapped (MetaWindow *window);
|
gboolean meta_window_is_mapped (MetaWindow *window);
|
||||||
gboolean meta_window_toplevel_is_mapped (MetaWindow *window);
|
gboolean meta_window_toplevel_is_mapped (MetaWindow *window);
|
||||||
gboolean meta_window_get_icon_geometry (MetaWindow *window,
|
gboolean meta_window_get_icon_geometry (MetaWindow *window,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user