New flag to ignore user input
Сергей Болотов
sbol at etersoft.ru
Thu Aug 27 08:45:01 PDT 2015
Hello everyone,
Our team has encountered situation in which window manager should
ignore all the user input for specific window. Such behaviour, similar
to win32 WS_DISABLED window style, needed, for example, when application
has many windows, one of which is showing modal message which requires
attention. The problem we faced is that if one of non-parent application
windows has _NET_WM_STATE_ABOVE, or even worse -
_NET_WM_STATE_FULLSCREEN flag of _NET_WM_STATE property, it will cover
modal window, thus not allowing user to continue work with app. We
consider adding new flag to the specification which will show WM that
window is disabled, thus preventing it from receiving user input,
changing its place in stacking order, activation and other manipulation
by WM. It may be an additional flag of _NET_WM_STATE property, named,
for example _NET_WM_STATE_DISABLED, and could be handled like this (in
xfwm4):
@@ handleButtonPress (DisplayInfo *display_info, XButtonEvent * ev)
client = myDisplayGetClientFromWindow (display_info, ev->window,
SEARCH_FRAME | SEARCH_WINDOW);
if (client)
{
+ XWMState wmState;
state = ev->state & MODIFIER_MASK;
win = ev->subwindow;
screen_info = client->screen_info;
+
+ XGetWMState(display, client->window, &wmState);
+ if(wmState.state & NET_WM_STATE_DISABLED)
+ {
+ /* Release pending events */
+ XAllowEvents (display_info->dpy, replay ? ReplayPointer :
SyncPointer, CurrentTime);
+
+ return EVENT_FILTER_REMOVE;
+ }
if ((ev->button == Button1) && (state) && (state ==
screen_info->params->easy_click))
{
Same for handleKeyPress.
Feel free to comment and criticise!
---
Regards,
Sergey Bolotov
More information about the xdg
mailing list