From: Jerome St-Louis Date: Sat, 15 Feb 2014 20:57:25 +0000 (+0900) Subject: ecere/gui/drivers/XInterface: Clarifying we want to use the Locally Active Input... X-Git-Tag: 0.44.09.9~43 X-Git-Url: http://ecere.com/cgi-bin/gitweb.cgi?p=sdk;a=commitdiff_plain;h=260b24d9af1ff0964d5570b91c0d71006e380ac6 ecere/gui/drivers/XInterface: Clarifying we want to use the Locally Active Input Model - See ICCM Section 4.1.7 Input Focus (http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7) - Setting WM_PROTOCOLS to receive ClientMessage with WM_TAKE_FOCUS - Setting the Input hint to true in WM_HINTS - Removed bad code setting WM_PROTOCOLS on the DefaultRootWindow --- diff --git a/ecere/src/gui/drivers/XInterface.ec b/ecere/src/gui/drivers/XInterface.ec index 9d8b072..5e28a4b 100644 --- a/ecere/src/gui/drivers/XInterface.ec +++ b/ecere/src/gui/drivers/XInterface.ec @@ -1369,12 +1369,6 @@ class XInterface : Interface } } - { - Atom protocols[2] = { atoms[wm_delete_window], atoms[wm_take_focus] }; - - XSetWMProtocols(xGlobalDisplay, DefaultRootWindow(xGlobalDisplay), protocols, 2); - } - /* if(atomsSupported[_net_workarea]) printf("Warning: _NET_WORKAREA extension not supported\n"); @@ -2399,6 +2393,17 @@ class XInterface : Interface windowHandle = XCreateWindow(xGlobalDisplay, DefaultRootWindow(xGlobalDisplay), 0,0,guiApp.desktop.size.w,guiApp.desktop.size.h,0, depth, InputOutput, visual ? visual : CopyFromParent, CWEventMask | (visual ? (CWColormap | CWBorderPixel) : 0)/*| CWOverrideRedirect*/, &attributes); + + { + XWMHints xwmHints; + xwmHints.flags = InputHint; + xwmHints.input = 0; + XSetWMHints(xGlobalDisplay, windowHandle, &xwmHints); + } + { + Atom protocols[2] = { atoms[wm_delete_window], atoms[wm_take_focus] }; + XSetWMProtocols(xGlobalDisplay, windowHandle, protocols, 2); + } } /* Unsupported for now... @@ -2606,16 +2611,12 @@ class XInterface : Interface } } - /* { - Atom protocolsAtom = XInternAtom(xGlobalDisplay, "WM_PROTOCOLS", False); - if ( protocolsAtom != None ) - { - MWM_Hints hints = { MWM_HINTS_DECORATIONS|MWM_HINTS_FUNCTIONS, 0, 0, 0, 0 }; - XChangeProperty(xGlobalDisplay, windowHandle, atoms[_motif_wm_hints], atoms[_motif_wm_hints], 32, - PropModeReplace, (unsigned char*)&hints, sizeof(hints)/4); - } - }*/ + XWMHints wmHints = { 0 }; + wmHints.input = True; + XSetWMHints(xGlobalDisplay, windowHandle, &wmHints); + } + // XFlush(xGlobalDisplay); window.windowData = XWindowData { visualInfo, ic };