X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fclient.cc;h=473c37f8f98fe8e33885059de69b45330abe4bb5;hb=ab2968b3a5d61e2dc6b0a64153a7abb0078ee442;hp=80cc1a2ca7e0bcc774fa43043dd337e7b61d53f4;hpb=406c79aea1b6f9c8bd1bbeb253ebc7cb97fc7e25;p=chaz%2Fopenbox diff --git a/src/client.cc b/src/client.cc index 80cc1a2c..473c37f8 100644 --- a/src/client.cc +++ b/src/client.cc @@ -8,6 +8,7 @@ #include "frame.hh" #include "screen.hh" #include "openbox.hh" +#include "bindings.hh" #include "otk/display.hh" #include "otk/property.hh" @@ -44,6 +45,8 @@ Client::Client(int screen, Window window) _transient_for = 0; // pick a layer to start from _layer = Layer_Normal; + // default to not urgent + _urgent = false; getArea(); getDesktop(); @@ -457,7 +460,7 @@ void Client::updateWMHints(bool initstate) // assume a window takes input if it doesnt specify _can_focus = true; - _urgent = false; + bool ur = false; if ((hints = XGetWMHints(**otk::display, _window)) != NULL) { if (hints->flags & InputHint) @@ -468,7 +471,7 @@ void Client::updateWMHints(bool initstate) _iconic = hints->initial_state == IconicState; if (hints->flags & XUrgencyHint) - _urgent = true; + ur = true; if (hints->flags & WindowGroupHint) { if (hints->window_group != _group) { @@ -481,6 +484,14 @@ void Client::updateWMHints(bool initstate) XFree(hints); } + + if (ur != _urgent) { + _urgent = ur; + // fire the urgent callback if we're mapped, otherwise, wait until after + // we're mapped + if (_urgent && frame) + fireUrgent(); + } } @@ -1174,6 +1185,8 @@ void Client::applyStartupState() _shaded = false; shade(true); } + if (_urgent) + fireUrgent(); if (_max_vert); // XXX: incomplete if (_max_horz); // XXX: incomplete @@ -1186,6 +1199,14 @@ void Client::applyStartupState() } +void Client::fireUrgent() +{ + // call the python UrgentNotify callbacks + EventData data(_screen, this, EventUrgentNotify, 0); + openbox->bindings()->fireEvent(&data); +} + + void Client::shade(bool shade) { if (!(_functions & Func_Shade) || // can't