From c84d748357b9fedfb6332fff5f987ca34d528837 Mon Sep 17 00:00:00 2001 From: tadam Date: Sat, 12 Dec 2009 21:48:43 +0000 Subject: [PATCH] Don't apply InitialMapCommand styles on restart. When restarting FVWM don't run any InitialMapCommand styles since the window is already mapped, and has the effect of simply toggling certain actions on that window. (c.f. Iconify, Maximize, etc.) --- ChangeLog | 10 ++++++++++ NEWS | 4 ++++ fvwm/events.c | 13 ++++++++++++- fvwm/fvwm.c | 5 +++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 345688587..3868dc6da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-12-12 Thomas Adam + * fvwm/fvwm.c (StartupStuff): + Reset the state of the "Restarting" flag to False when restarting FVWM. + + * fvwm/events.c (HandleMapRequestKeepRaised): + Only run InitialMapCommand when FVWM isn't restarting and all windows + have been recaptured. The window is already mapped by the time FVWM is + restarting, and running the InitialMapCommand again only serves to + "toggle" the window state (c.f. InitialMapCommand Iconic, etc.) + 2009-09-20 Viktor Griph * NEWS: diff --git a/NEWS b/NEWS index 55368318c..d5357a0b8 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,10 @@ Note, the changes for the last STABLE release start with release ------------------------------------------------------------------- Changes in beta release 2.5.29 (not released yet) +* Bug fixes: + - Fixed the InitialMapCommand style from running when FVWM + is restarting. + Changes in beta release 2.5.28 (20-Sep-2009) * New features: diff --git a/fvwm/events.c b/fvwm/events.c index ac40a4744..b89efae9e 100644 --- a/fvwm/events.c +++ b/fvwm/events.c @@ -2878,6 +2878,7 @@ void HandleMapRequestKeepRaised( initial_window_options_t win_opts_bak; Window ew; FvwmWindow *fw; + extern Bool Restarting; const char *initial_map_command; initial_map_command = NULL; @@ -3101,7 +3102,17 @@ void HandleMapRequestKeepRaised( * allow for correct timings when the window is truly * mapped. (c.f. things like Iconify.) */ - if (initial_map_command != NULL) + + /* TA: 20091212: But only do this when we're *not* + * restarting -- the window is still mapped, but gets + * recaptured -- we don't want to trigger this event + * again. Otherwise we end up toggling the state of + * the window in situations where the + * InitialMapCommand is Iconify or Maximize, for + * instance. + */ + if ((initial_map_command != NULL) && + (!Restarting && Scr.flags.are_windows_captured)) { execute_function_override_window( NULL, ea->exc, diff --git a/fvwm/fvwm.c b/fvwm/fvwm.c index 34f8e5006..7096baa04 100644 --- a/fvwm/fvwm.c +++ b/fvwm/fvwm.c @@ -1590,6 +1590,11 @@ void StartupStuff(void) } exc_destroy_context(exc); + /* TA: 20091212: If we get here, we're done restarting, so reset the + * flag back to False! + */ + Restarting = False; + return; } -- 2.11.4.GIT