From 5fe06b5fff032549391523e55c2d64c4f1475792 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Wed, 26 Jan 2005 23:25:05 +0000 Subject: [PATCH] Stick and unstick transients with their parent automatically. Fixes 2005-01-26 Elijah Newren Stick and unstick transients with their parent automatically. Fixes #152283. * src/window.c: (window_stick_impl, window_unstick_impl): rename from meta_window_stick and meta_window_unstick respectively, (stick_foreach_func): a function to assist calling window_(un)stick_impl on each transient, (meta_window_stick, meta_window_unstick): new functions that call window_stick_impl or window_unstick_impl for the window and each of its transients. --- ChangeLog | 12 ++++++++++++ src/window.c | 42 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 642693e20..774961c3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-01-26 Elijah Newren + + Stick and unstick transients with their parent automatically. + Fixes #152283. + + * src/window.c: (window_stick_impl, window_unstick_impl): rename + from meta_window_stick and meta_window_unstick respectively, + (stick_foreach_func): a function to assist calling + window_(un)stick_impl on each transient, (meta_window_stick, + meta_window_unstick): new functions that call window_stick_impl or + window_unstick_impl for the window and each of its transients. + 2005-01-26 Elijah Newren Patch from John Paul Wallington to keep tooltip on screen diff --git a/src/window.c b/src/window.c index 551149cee..61bd082d1 100644 --- a/src/window.c +++ b/src/window.c @@ -3421,8 +3421,8 @@ meta_window_change_workspace (MetaWindow *window, workspace); } -void -meta_window_stick (MetaWindow *window) +static void +window_stick_impl (MetaWindow *window) { GList *tmp; MetaWorkspace *workspace; @@ -3456,8 +3456,8 @@ meta_window_stick (MetaWindow *window) meta_window_queue_calc_showing (window); } -void -meta_window_unstick (MetaWindow *window) +static void +window_unstick_impl (MetaWindow *window) { GList *tmp; MetaWorkspace *workspace; @@ -3492,6 +3492,40 @@ meta_window_unstick (MetaWindow *window) meta_window_queue_calc_showing (window); } +static gboolean +stick_foreach_func (MetaWindow *window, + void *data) +{ + gboolean stick; + + stick = *(gboolean*)data; + if (stick) + window_stick_impl (window); + else + window_unstick_impl (window); + return TRUE; +} + +void +meta_window_stick (MetaWindow *window) +{ + gboolean stick = TRUE; + window_stick_impl (window); + meta_window_foreach_transient (window, + stick_foreach_func, + &stick); +} + +void +meta_window_unstick (MetaWindow *window) +{ + gboolean stick = FALSE; + window_unstick_impl (window); + meta_window_foreach_transient (window, + stick_foreach_func, + &stick); +} + unsigned long meta_window_get_net_wm_desktop (MetaWindow *window) {