mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-23 20:01:22 +00:00
Merge pull request #7 from trunkmaster/master
Handle `-autolaunch YES` application argument
This commit is contained in:
commit
ee865548bf
3 changed files with 28 additions and 1 deletions
|
@ -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>
|
2019-03-26 Sergii Stoian <stoyan255@gmail.com>
|
||||||
* Source/x11/XGServerWindow.m:
|
* Source/x11/XGServerWindow.m:
|
||||||
(setwindowlevel::) Set `Utility` window type for NSFloatingWindowLevel.
|
(setwindowlevel::) Set `Utility` window type for NSFloatingWindowLevel.
|
||||||
|
|
|
@ -108,7 +108,8 @@ static char *atom_names[] = {
|
||||||
"_GNUSTEP_WM_MINIATURIZE_WINDOW",
|
"_GNUSTEP_WM_MINIATURIZE_WINDOW",
|
||||||
"_GNUSTEP_WM_ATTR",
|
"_GNUSTEP_WM_ATTR",
|
||||||
"_GNUSTEP_TITLEBAR_STATE",
|
"_GNUSTEP_TITLEBAR_STATE",
|
||||||
"_GNUSTEP_FRAME_OFFSETS"
|
"_GNUSTEP_FRAME_OFFSETS",
|
||||||
|
"WM_IGNORE_FOCUS_EVENTS"
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -181,6 +182,7 @@ static char *atom_names[] = {
|
||||||
#define _GNUSTEP_WM_ATTR_ATOM atoms[64]
|
#define _GNUSTEP_WM_ATTR_ATOM atoms[64]
|
||||||
#define _GNUSTEP_TITLEBAR_STATE_ATOM atoms[65]
|
#define _GNUSTEP_TITLEBAR_STATE_ATOM atoms[65]
|
||||||
#define _GNUSTEP_FRAME_OFFSETS_ATOM atoms[66]
|
#define _GNUSTEP_FRAME_OFFSETS_ATOM atoms[66]
|
||||||
|
#define WM_IGNORE_FOCUS_EVENTS_ATOM atoms[67]
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Frame offsets for window inside parent decoration window.
|
* Frame offsets for window inside parent decoration window.
|
||||||
|
|
|
@ -2815,6 +2815,24 @@ static BOOL didCreatePixmaps;
|
||||||
*/
|
*/
|
||||||
if ((window->win_attrs.window_style & NSIconWindowMask) != 0)
|
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 WindowMaker to ignore focus events
|
||||||
|
ev.xclient.type = ClientMessage;
|
||||||
|
ev.xclient.message_type = generic.WM_IGNORE_FOCUS_EVENTS_ATOM;
|
||||||
|
ev.xclient.format = 32;
|
||||||
|
ev.xclient.data.l[0] = True;
|
||||||
|
XSendEvent(dpy, ROOT, True, EnterWindowMask, &ev);
|
||||||
|
// Display application icon
|
||||||
|
XMapWindow(dpy, ROOT);
|
||||||
|
// Inform WindowMaker to process focus events again
|
||||||
|
ev.xclient.data.l[0] = False;
|
||||||
|
XSendEvent(dpy, ROOT, True, EnterWindowMask, &ev);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((window->win_attrs.window_style & NSMiniWindowMask) != 0)
|
if ((window->win_attrs.window_style & NSMiniWindowMask) != 0)
|
||||||
|
|
Loading…
Reference in a new issue