mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
Do not change workspace during deiconify animation
Paul Harris reported that using the mouse wheel over a miniwindow would deiconify it to a different workspace than the original one where it was iconified. This happens because after the window begins to be deiconified the "residual" mouse wheel scrolling hits the workspace background, and Window Maker changes workspace with wWorkspaceRelativeChange(). But if it all happens fast enough (so the deiconification animation did not finish yet) the workspace will have changed before the window reaches its final deiconified destination, leading to the situation that Paul described in the link below. So to avoid this, let's set a 'ignore_wks_change' variable from wDeiconifyWindow() and make wWorkspaceRelativeChange() respect it. Original report: http://lists.windowmaker.info/dev/msg00821.html
This commit is contained in:
@@ -49,6 +49,8 @@
|
|||||||
#include "xinerama.h"
|
#include "xinerama.h"
|
||||||
|
|
||||||
/****** Global Variables ******/
|
/****** Global Variables ******/
|
||||||
|
|
||||||
|
int ignore_wks_change = 0;
|
||||||
extern Time LastTimestamp;
|
extern Time LastTimestamp;
|
||||||
extern Time LastFocusChange;
|
extern Time LastFocusChange;
|
||||||
|
|
||||||
@@ -1109,6 +1111,9 @@ void wIconifyWindow(WWindow * wwin)
|
|||||||
|
|
||||||
void wDeiconifyWindow(WWindow * wwin)
|
void wDeiconifyWindow(WWindow * wwin)
|
||||||
{
|
{
|
||||||
|
/* Let's avoid changing workspace while deiconifying */
|
||||||
|
ignore_wks_change = 1;
|
||||||
|
|
||||||
/* we're hiding for show_desktop */
|
/* we're hiding for show_desktop */
|
||||||
int netwm_hidden = wwin->flags.net_show_desktop &&
|
int netwm_hidden = wwin->flags.net_show_desktop &&
|
||||||
wwin->frame->workspace != wwin->screen_ptr->current_workspace;
|
wwin->frame->workspace != wwin->screen_ptr->current_workspace;
|
||||||
@@ -1230,6 +1235,8 @@ void wDeiconifyWindow(WWindow * wwin)
|
|||||||
/* In case we were shaded and iconified, also unshade */
|
/* In case we were shaded and iconified, also unshade */
|
||||||
if (!netwm_hidden)
|
if (!netwm_hidden)
|
||||||
wUnshadeWindow(wwin);
|
wUnshadeWindow(wwin);
|
||||||
|
|
||||||
|
ignore_wks_change = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hideWindow(WIcon * icon, int icon_x, int icon_y, WWindow * wwin, int animate)
|
static void hideWindow(WIcon * icon, int icon_x, int icon_y, WWindow * wwin, int animate)
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
#define MAX_SHORTCUT_LENGTH 32
|
#define MAX_SHORTCUT_LENGTH 32
|
||||||
#define WORKSPACE_NAME_DISPLAY_PADDING 32
|
#define WORKSPACE_NAME_DISPLAY_PADDING 32
|
||||||
|
|
||||||
|
extern int ignore_wks_change;
|
||||||
extern WPreferences wPreferences;
|
extern WPreferences wPreferences;
|
||||||
extern XContext wWinContext;
|
extern XContext wWinContext;
|
||||||
extern XContext wVEdgeContext;
|
extern XContext wVEdgeContext;
|
||||||
@@ -441,6 +442,13 @@ void wWorkspaceRelativeChange(WScreen * scr, int amount)
|
|||||||
{
|
{
|
||||||
int w;
|
int w;
|
||||||
|
|
||||||
|
/* While the deiconify animation is going on the window is
|
||||||
|
* still "flying" to its final position and we don't want to
|
||||||
|
* change workspace before the animation finishes, otherwise
|
||||||
|
* the window will land in the new workspace */
|
||||||
|
if (ignore_wks_change)
|
||||||
|
return;
|
||||||
|
|
||||||
w = scr->current_workspace + amount;
|
w = scr->current_workspace + amount;
|
||||||
|
|
||||||
if (amount < 0) {
|
if (amount < 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user