mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 00:30:58 +00:00
Merge branch 'master' of github.com:gnustep/libs-gui into bug33395_uses_single_line_mode
This commit is contained in:
commit
ae49b8374a
7 changed files with 113 additions and 24 deletions
48
ChangeLog
48
ChangeLog
|
@ -1,3 +1,51 @@
|
|||
2019-04-08 Sergii Stoian <stoyan255@ukr.net>
|
||||
|
||||
* Source/NSApplication.m (becomesKeyOnlyIfNeeded): override NSWindow
|
||||
methodin appicon to reduce number of order front calls. The source
|
||||
of the call is NSWindow's sendEvent:.
|
||||
|
||||
2019-04-06 Sergii Stoian <stoyan255@ukr.net>
|
||||
|
||||
* Headers/Additions/GNUstepGUI/GSDisplayServer.h,
|
||||
* Source/NSApplication.m,
|
||||
* Source/GSDisplayServer.m: `hidewindow` method was renamed to
|
||||
`hideApplication`
|
||||
|
||||
* Source/NSApplication.m (hide:): Change comment before call to
|
||||
`hidewindow`.
|
||||
|
||||
* Source/GSDisplayServer.m (hidewindow:): fixes to return value and type.
|
||||
Change comment.
|
||||
|
||||
2019-04-05 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Headers/AppKit/NSEvent.h: new event subtype `GSAppKitAppHide` was added.
|
||||
* Source/NSWindow.m (sendEvent:): handle "GSAppKitAppHide" event subtype.
|
||||
|
||||
* Headers/Additions/GNUstepGUI/GSDisplayServer.h,
|
||||
* Source/GSDisplayServer.m (hidewindow:): new methods was added.
|
||||
|
||||
* Source/NSApplication.m (hide:): Send -hidewindow: to to the main menu.
|
||||
If window manager doesn't support _GNUSTEP_HIDE_APP atom - hide windows
|
||||
by ourself.
|
||||
|
||||
2019-04-03 Sergii Stoian <stoyan255@ukr.net>
|
||||
|
||||
* Source/NSApplication.m (activateIgnoringOtherApps:):
|
||||
Optimize `-autolaunch YES` checking code.
|
||||
|
||||
2019-04-02 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Source/NSApplication.m:
|
||||
(activateIgnoringOtherApps:) Do not activate application on first run
|
||||
if commandline argument `-autolaunch YES` was specified.
|
||||
|
||||
2019-03-27 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Headers/AppKit/NSWindow.h:
|
||||
Lowering down NSFloatingWindowLevel number by one to distinguish
|
||||
floating panels from menus.
|
||||
|
||||
2019-02-26 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSBitmapImageRep+ICNS.m (_imageRepsWithICNSData:): Try to
|
||||
|
|
|
@ -136,6 +136,7 @@ APPKIT_EXPORT NSString *GSScreenNumber;
|
|||
- (void) windowbacking: (NSBackingStoreType)type : (int)win;
|
||||
- (void) titlewindow: (NSString *)window_title : (int)win;
|
||||
- (void) miniwindow: (int)win;
|
||||
- (BOOL) hideApplication: (int)win;
|
||||
- (BOOL) appOwnsMiniwindow;
|
||||
- (void) setWindowdevice: (int)win forContext: (NSGraphicsContext *)ctxt;
|
||||
// Deprecated
|
||||
|
|
|
@ -532,6 +532,7 @@ typedef enum {
|
|||
GSAppKitDraggingFinished,
|
||||
GSAppKitRegionExposed,
|
||||
GSAppKitWindowDeminiaturize,
|
||||
GSAppKitAppHide
|
||||
} GSAppKitSubtype;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
enum {
|
||||
NSDesktopWindowLevel = -1000, /* GNUstep addition */ // 2
|
||||
NSNormalWindowLevel = 0, // 3
|
||||
NSFloatingWindowLevel = 3, // 4
|
||||
NSFloatingWindowLevel = 2, // 4
|
||||
NSSubmenuWindowLevel = 3, // 5
|
||||
NSTornOffMenuWindowLevel = 3, // 5
|
||||
NSMainMenuWindowLevel = 20, // 7
|
||||
|
|
|
@ -601,6 +601,13 @@ GSCurrentServer(void)
|
|||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
/** Ask the window manager to hide all the application windows for us.
|
||||
Return whether they have been hidden. */
|
||||
- (BOOL) hideApplication: (int) win
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
/** Returns YES if the application should create the miniwindow counterpart
|
||||
to the full size window and own it. Some display systems handle the
|
||||
miniwindow themselves. In this case the backend subclass should
|
||||
|
|
|
@ -434,6 +434,11 @@ NSApplication *NSApp = nil;
|
|||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) becomesKeyOnlyIfNeeded
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL) worksWhenModal
|
||||
{
|
||||
return YES;
|
||||
|
@ -753,6 +758,8 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
|
|||
*/
|
||||
@implementation NSApplication
|
||||
|
||||
static BOOL _isAutolaunchChecked = NO;
|
||||
|
||||
/*
|
||||
* Class methods
|
||||
*/
|
||||
|
@ -1259,6 +1266,21 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
|
|||
*/
|
||||
- (void) activateIgnoringOtherApps: (BOOL)flag
|
||||
{
|
||||
if (_isAutolaunchChecked == NO)
|
||||
{
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSString *autolaunch = [defaults objectForKey: @"autolaunch"];
|
||||
|
||||
_isAutolaunchChecked = YES;
|
||||
|
||||
/* Application was executed with an argument '-autolaunch YES'.
|
||||
Do not activate application on first call. */
|
||||
if (autolaunch && [autolaunch isEqualToString: @"YES"])
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Currently the flag is ignored
|
||||
if (_app_is_active == NO)
|
||||
{
|
||||
|
@ -2479,30 +2501,36 @@ image.</p><p>See Also: -applicationIconImage</p>
|
|||
[_hidden_main resignMainWindow];
|
||||
}
|
||||
|
||||
windows_list = GSOrderedWindows();
|
||||
iter = [windows_list reverseObjectEnumerator];
|
||||
/** Ask the window manager to hide all the application windows for us.
|
||||
Return whether they have been hidden. */
|
||||
win = [[self mainMenu] window];
|
||||
if ([GSServerForWindow(win) hideApplication: [win windowNumber]] == NO)
|
||||
{
|
||||
windows_list = GSOrderedWindows();
|
||||
iter = [windows_list reverseObjectEnumerator];
|
||||
|
||||
while ((win = [iter nextObject]))
|
||||
{
|
||||
if ([win isVisible] == NO && ![win isMiniaturized])
|
||||
{
|
||||
continue; /* Already invisible */
|
||||
}
|
||||
if ([win canHide] == NO)
|
||||
{
|
||||
continue; /* Not hideable */
|
||||
}
|
||||
if (win == _app_icon_window)
|
||||
{
|
||||
continue; /* can't hide the app icon. */
|
||||
}
|
||||
if (_app_is_active == YES && [win hidesOnDeactivate] == YES)
|
||||
{
|
||||
continue; /* Will be hidden by deactivation */
|
||||
}
|
||||
[_hidden addObject: win];
|
||||
[win orderOut: self];
|
||||
}
|
||||
while ((win = [iter nextObject]))
|
||||
{
|
||||
if ([win isVisible] == NO && ![win isMiniaturized])
|
||||
{
|
||||
continue; /* Already invisible */
|
||||
}
|
||||
if ([win canHide] == NO)
|
||||
{
|
||||
continue; /* Not hideable */
|
||||
}
|
||||
if (win == _app_icon_window)
|
||||
{
|
||||
continue; /* can't hide the app icon. */
|
||||
}
|
||||
if (_app_is_active == YES && [win hidesOnDeactivate] == YES)
|
||||
{
|
||||
continue; /* Will be hidden by deactivation */
|
||||
}
|
||||
[_hidden addObject: win];
|
||||
[win orderOut: self];
|
||||
}
|
||||
}
|
||||
_app_is_hidden = YES;
|
||||
|
||||
if (YES == [[NSUserDefaults standardUserDefaults]
|
||||
|
|
|
@ -4224,6 +4224,10 @@ checkCursorRectanglesExited(NSView *theView, NSEvent *theEvent, NSPoint lastPoi
|
|||
[self performMiniaturize: NSApp];
|
||||
break;
|
||||
|
||||
case GSAppKitAppHide:
|
||||
[NSApp hide: self];
|
||||
break;
|
||||
|
||||
case GSAppKitWindowFocusIn:
|
||||
if (_f.is_miniaturized)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue