summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Catherwood <jay.catherwood@gmail.com>2010-08-05 14:25:35 -0400
committerSam Spilsbury <smspillaz@gmail.com>2010-08-08 11:14:11 +0800
commit1a55007dad2dfd1c1fbe5d5e2f03e0ff93c08e5a (patch)
tree25a0d66438bb12877f0d77bc9b5d472baf89644c
parent6cf402ae98d55a03cfa8d896380ef3b53f17eef2 (diff)
downloadworkarounds-1a55007dad2dfd1c1fbe5d5e2f03e0ff93c08e5a.tar.gz
workarounds-1a55007dad2dfd1c1fbe5d5e2f03e0ff93c08e5a.tar.bz2
Fix java windows disappearing from taskbar
Certain java windows are marking themselves as transient when a modal dialog is opened, causing them to vanish from the taskbar. This workaround notices when they are unmarked as transient and puts them back.
-rw-r--r--src/workarounds.cpp50
-rw-r--r--src/workarounds.h3
-rw-r--r--workarounds.xml.in5
3 files changed, 57 insertions, 1 deletions
diff --git a/src/workarounds.cpp b/src/workarounds.cpp
index 54db4d7..3f3e430 100644
--- a/src/workarounds.cpp
+++ b/src/workarounds.cpp
@@ -268,6 +268,49 @@ WorkaroundsWindow::updateUrgencyState ()
}
}
+/* Use this function to forcibly refresh java window properties when they
+ * have been unmarked as transient. This is just a copy of
+ * PrivateScreen::setWindowState. I would use CompWindow::changeState, but
+ * it checks whether oldstate==newstate
+ */
+void
+WorkaroundsScreen::setWindowState (unsigned int state, Window id)
+{
+ Atom data[32];
+ int i = 0;
+
+ if (state & CompWindowStateModalMask)
+ data[i++] = Atoms::winStateModal;
+ if (state & CompWindowStateStickyMask)
+ data[i++] = Atoms::winStateSticky;
+ if (state & CompWindowStateMaximizedVertMask)
+ data[i++] = Atoms::winStateMaximizedVert;
+ if (state & CompWindowStateMaximizedHorzMask)
+ data[i++] = Atoms::winStateMaximizedHorz;
+ if (state & CompWindowStateShadedMask)
+ data[i++] = Atoms::winStateShaded;
+ if (state & CompWindowStateSkipTaskbarMask)
+ data[i++] = Atoms::winStateSkipTaskbar;
+ if (state & CompWindowStateSkipPagerMask)
+ data[i++] = Atoms::winStateSkipPager;
+ if (state & CompWindowStateHiddenMask)
+ data[i++] = Atoms::winStateHidden;
+ if (state & CompWindowStateFullscreenMask)
+ data[i++] = Atoms::winStateFullscreen;
+ if (state & CompWindowStateAboveMask)
+ data[i++] = Atoms::winStateAbove;
+ if (state & CompWindowStateBelowMask)
+ data[i++] = Atoms::winStateBelow;
+ if (state & CompWindowStateDemandsAttentionMask)
+ data[i++] = Atoms::winStateDemandsAttention;
+ if (state & CompWindowStateDisplayModalMask)
+ data[i++] = Atoms::winStateDisplayModal;
+
+ XChangeProperty (screen->dpy (), id, Atoms::winState,
+ XA_ATOM, 32, PropModeReplace,
+ (unsigned char *) data, i);
+}
+
void
WorkaroundsWindow::getAllowedActions (unsigned int &setActions,
unsigned int &clearActions)
@@ -608,6 +651,13 @@ WorkaroundsScreen::handleEvent (XEvent *event)
}
}
}
+ else if (event->xproperty.atom == Atoms::clientList) {
+ if (optionGetJavaTaskbarFix ()) {
+ foreach (CompWindow *w, screen->windows ()) {
+ setWindowState (w->state (), w->id ());
+ }
+ }
+ }
break;
default:
break;
diff --git a/src/workarounds.h b/src/workarounds.h
index 8f3a665..e8ef0c7 100644
--- a/src/workarounds.h
+++ b/src/workarounds.h
@@ -99,7 +99,8 @@ class WorkaroundsScreen :
void
checkFunctions (bool window, bool screen);
-
+ void
+ setWindowState (unsigned int state, Window id);
};
diff --git a/workarounds.xml.in b/workarounds.xml.in
index 9a905af..c6bd4a0 100644
--- a/workarounds.xml.in
+++ b/workarounds.xml.in
@@ -43,6 +43,11 @@
<_long>Fix window type of various Java windows.</_long>
<default>true</default>
</option>
+ <option type="bool" name="java_taskbar_fix">
+ <_short>Java Taskbar Fix</_short>
+ <_long>Fix java windows disappearing from taskbar</_long>
+ <default>true</default>
+ </option>
<option type="bool" name="qt_fix">
<_short>Qt Window Fix</_short>
<_long>Fix window type of various Qt windows.</_long>