summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2008-06-10 23:34:42 +0200
committerDanny Baumann <dannybaumann@web.de>2008-06-10 23:34:42 +0200
commit0ca43b99e094fc82f2e255934db7771bbbff1f8d (patch)
tree42db74da42b114a498ff1dbed9baf51134e46d76
parent3ab8e324325a44217e6215cbb3ace5d748e520d9 (diff)
downloadworkarounds-0ca43b99e094fc82f2e255934db7771bbbff1f8d.tar.gz
workarounds-0ca43b99e094fc82f2e255934db7771bbbff1f8d.tar.bz2
Added an option for converting urgency to demands_attention state.
-rw-r--r--workarounds.c40
-rw-r--r--workarounds.xml.in7
2 files changed, 46 insertions, 1 deletions
diff --git a/workarounds.c b/workarounds.c
index 6f88a4a..38e1000 100644
--- a/workarounds.c
+++ b/workarounds.c
@@ -67,6 +67,7 @@ typedef struct _WorkaroundsWindow {
Bool madeSticky;
Bool madeFullscreen;
Bool isFullscreen;
+ Bool madeDemandAttention;
} WorkaroundsWindow;
#define GET_WORKAROUNDS_DISPLAY(d) \
@@ -271,6 +272,35 @@ workaroundsUpdateSticky (CompWindow *w)
}
static void
+updateUrgencyState (CompWindow *w)
+{
+ XWMHints *hints;
+ Bool urgent = FALSE;
+
+ WORKAROUNDS_WINDOW (w);
+
+ hints = XGetWMHints (w->screen->display->display, w->id);
+ if (hints)
+ {
+ if (hints->flags & XUrgencyHint)
+ urgent = TRUE;
+
+ XFree (hints);
+ }
+
+ if (urgent)
+ {
+ ww->madeDemandAttention = TRUE;
+ changeWindowState (w, w->state | CompWindowStateDemandsAttentionMask);
+ }
+ else if (ww->madeDemandAttention)
+ {
+ ww->madeDemandAttention = FALSE;
+ changeWindowState (w, w->state & ~CompWindowStateDemandsAttentionMask);
+ }
+}
+
+static void
workaroundsGetAllowedActionsForWindow (CompWindow *w,
unsigned int *setActions,
unsigned int *clearActions)
@@ -588,6 +618,15 @@ workaroundsHandleEvent (CompDisplay *d,
if (w)
workaroundsDoFixes (w);
}
+ else if (event->xproperty.atom == XA_WM_HINTS)
+ {
+ if (workaroundsGetConvertUrgency (d))
+ {
+ w = findWindowAtDisplay (d, event->xproperty.window);
+ if (w)
+ updateUrgencyState (w);
+ }
+ }
break;
default:
break;
@@ -728,6 +767,7 @@ workaroundsInitWindow (CompPlugin *plugin, CompWindow *w)
ww->adjustedWinType = FALSE;
ww->isFullscreen = FALSE;
ww->madeFullscreen = FALSE;
+ ww->madeDemandAttention = FALSE;
w->base.privates[ws->windowPrivateIndex].ptr = ww;
diff --git a/workarounds.xml.in b/workarounds.xml.in
index 5790c1f..6dae654 100644
--- a/workarounds.xml.in
+++ b/workarounds.xml.in
@@ -37,7 +37,12 @@
<_short>Qt Window Fix</_short>
<_long>Fix window type of various Qt windows.</_long>
<default>true</default>
- </option>
+ </option>
+ <option type="bool" name="convert_urgency">
+ <_short>Convert Urgency to Demands Attention</_short>
+ <_long>Make "urgent" windows also "demand attention".</_long>
+ <default>false</default>
+ </option>
<option type="bool" name="aiglx_fragment_fix">
<_short>AIGLX Fragment Parameter Fix</_short>
<_long>Fix broken glProgramEnvParameter4f implementation.</_long>