summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2011-05-26 20:52:31 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2011-05-26 20:52:31 +0800
commit870bc2cb5029d1a67d6249e6085012a9c6186579 (patch)
tree3090e77dbebc84cdbf39060219ddafd6e57894ca
parent53f984e74cddba74fc5068e7620dd066637197fa (diff)
downloadworkarounds-870bc2cb5029d1a67d6249e6085012a9c6186579.tar.gz
workarounds-870bc2cb5029d1a67d6249e6085012a9c6186579.tar.bz2
Don't write w->type () to w->wmType (). Instead back up the existing
wmType and new wmType every time it changes and we apply the fix and then write that in when appropriate. Writing back w->type () causes bugs in window matching. Fixes LP #765422
-rw-r--r--src/workarounds.cpp22
-rw-r--r--src/workarounds.h2
2 files changed, 11 insertions, 13 deletions
diff --git a/src/workarounds.cpp b/src/workarounds.cpp
index 7911cd8..27d16fb 100644
--- a/src/workarounds.cpp
+++ b/src/workarounds.cpp
@@ -689,11 +689,14 @@ WorkaroundsWindow::updateFixedWindow (unsigned int newWmType)
if (newWmType != window->wmType ())
{
adjustedWinType = TRUE;
+ oldWmType = window->wmType ();
window->recalcType ();
window->recalcActions ();
screen->matchPropertyChanged (window);
+
+ window->wmType () = newWmType;
}
}
@@ -706,7 +709,7 @@ WorkaroundsWindow::getFixedWindowType ()
WORKAROUNDS_SCREEN (screen);
- newWmType = window->type (); // ???
+ newWmType = window->wmType ();
if (!XGetClassHint (screen->dpy (), window->id (), &classHint) != Success)
return newWmType;
@@ -725,7 +728,6 @@ WorkaroundsWindow::getFixedWindowType ()
resName.compare("notification-daemon") == 0)
{
newWmType = CompWindowTypeNotificationMask;
- updateFixedWindow (newWmType);
return newWmType;
}
}
@@ -739,7 +741,6 @@ WorkaroundsWindow::getFixedWindowType ()
(resName.compare ( "popup") == 0))
{
newWmType = CompWindowTypeDropdownMenuMask;
- updateFixedWindow (newWmType);
return newWmType;
}
}
@@ -753,7 +754,6 @@ WorkaroundsWindow::getFixedWindowType ()
if (resName.compare ( "VCLSalFrame") == 0)
{
newWmType = CompWindowTypeDropdownMenuMask;
- updateFixedWindow (newWmType);
return newWmType;
}
}
@@ -765,19 +765,16 @@ WorkaroundsWindow::getFixedWindowType ()
(resName.compare ( "sun-awt-X11-XWindowPeer") == 0))
{
newWmType = CompWindowTypeDropdownMenuMask;
- updateFixedWindow (newWmType);
return newWmType;
}
else if (resName.compare ( "sun-awt-X11-XDialogPeer") == 0)
{
newWmType = CompWindowTypeDialogMask;
- updateFixedWindow (newWmType);
return newWmType;
}
else if (resName.compare ( "sun-awt-X11-XFramePeer") == 0)
{
newWmType = CompWindowTypeNormalMask;
- updateFixedWindow (newWmType);
return newWmType;
}
}
@@ -794,7 +791,6 @@ WorkaroundsWindow::getFixedWindowType ()
(windowRole.compare ("qtooltip_label") == 0))
{
newWmType = CompWindowTypeTooltipMask;
- updateFixedWindow (newWmType);
return newWmType;
}
}
@@ -805,7 +801,6 @@ WorkaroundsWindow::getFixedWindowType ()
(newWmType == CompWindowTypeUnknownMask))
{
newWmType = CompWindowTypeDropdownMenuMask;
- updateFixedWindow (newWmType);
return newWmType;
}
}
@@ -919,7 +914,7 @@ WorkaroundsScreen::handleEvent (XEvent *event)
{
WORKAROUNDS_WINDOW (w);
ww->updateSticky ();
- w->wmType () = ww->getFixedWindowType ();
+ ww->updateFixedWindow (ww->getFixedWindowType ());
ww->fixupFullscreen ();
}
break;
@@ -928,7 +923,7 @@ WorkaroundsScreen::handleEvent (XEvent *event)
if (w && w->overrideRedirect ())
{
WORKAROUNDS_WINDOW (w);
- w->wmType () = ww->getFixedWindowType ();
+ ww->updateFixedWindow (ww->getFixedWindowType ());
}
break;
case DestroyNotify:
@@ -970,7 +965,7 @@ WorkaroundsScreen::handleEvent (XEvent *event)
if (w)
{
WORKAROUNDS_WINDOW (w);
- w->wmType () = ww->getFixedWindowType ();
+ ww->updateFixedWindow (ww->getFixedWindowType ());
}
}
else if (event->xproperty.atom == XA_WM_HINTS)
@@ -1093,6 +1088,7 @@ WorkaroundsWindow::WorkaroundsWindow (CompWindow *window) :
isFullscreen (false),
madeDemandAttention (false),
isMinimized (window->minimized ()),
+ oldWmType (window->wmType ()),
windowHideInfo (NULL)
{
WindowInterface::setHandler (window, false);
@@ -1147,7 +1143,7 @@ WorkaroundsWindow::~WorkaroundsWindow ()
{
if (adjustedWinType)
{
- window->wmType () = window->type ();
+ window->wmType () = oldWmType;
window->recalcType ();
window->recalcActions ();
}
diff --git a/src/workarounds.h b/src/workarounds.h
index 9665fc2..132cecf 100644
--- a/src/workarounds.h
+++ b/src/workarounds.h
@@ -154,6 +154,8 @@ class WorkaroundsWindow :
bool madeDemandAttention;
bool isMinimized;
+ unsigned int oldWmType;
+
HideInfo *windowHideInfo;
bool