Map application icon window without focus switch for applications executed with argument -autolaunch YES in WindowMaker environment.

This commit is contained in:
Sergii Stoian 2019-04-02 19:38:44 +03:00
parent f4d01bab0c
commit a6595e320d
2 changed files with 25 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2019-04-02 Sergii Stoian <stoyan255@gmail.com>
* Source/x11/XGServerWindow.m:
(orderwindow:::) Map application icon window without focus flickering
for applications executed with argument `-autolaunch YES` in WindowMaker
environment.
2019-03-26 Sergii Stoian <stoyan255@gmail.com>
* Source/x11/XGServerWindow.m:
(setwindowlevel::) Set `Utility` window type for NSFloatingWindowLevel.

View file

@ -2815,6 +2815,24 @@ static BOOL didCreatePixmaps;
*/
if ((window->win_attrs.window_style & NSIconWindowMask) != 0)
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if (op != NSWindowOut && window->map_state == IsUnmapped &&
[[defaults objectForKey: @"autolaunch"] isEqualToString:@"YES"])
{
XEvent ev;
// Inform WM to ignore focus events
ev.xclient.type = ClientMessage;
ev.xclient.message_type = XInternAtom(dpy,"WM_IGNORE_FOCUS_EVENTS", False);
ev.xclient.format = 32;
ev.xclient.data.l[0] = True;
XSendEvent(dpy, ROOT, True, EnterWindowMask, &ev);
// Display application icon
XMapWindow(dpy, ROOT);
// Inform WM to process focus events again
ev.xclient.data.l[0] = False;
XSendEvent(dpy, ROOT, True, EnterWindowMask, &ev);
}
return;
}
if ((window->win_attrs.window_style & NSMiniWindowMask) != 0)