Commit graph

414 commits

Author SHA1 Message Date
Wolfgang Lux
503ebee65b Create the app icon in NSApplication -_init as suggested by Fred.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33244 72102866-910b-0410-8b05-ffd578937521
2011-06-04 15:07:54 +00:00
Wolfgang Lux
139afd0eef Revert to creating the app icon in finishLaunching, since existing
applications that do not use NSApplicationMain otherwise won't get an
app icon.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33242 72102866-910b-0410-8b05-ffd578937521
2011-06-04 08:42:33 +00:00
Wolfgang Lux
12865cbdb9 Ensure that applications get a proper app icon under WindowMaker even
when their main nib contains visible at launch time windows.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33231 72102866-910b-0410-8b05-ffd578937521
2011-06-02 08:45:07 +00:00
Wolfgang Lux
78fb85fbcf Fix management of windows whose hide on deactivate attribute is set.
In particular, such windows remain ordered out when the application
orders them out while it is not active and then is activated again.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33213 72102866-910b-0410-8b05-ffd578937521
2011-05-31 09:59:48 +00:00
David Chisnall
b4e3915c33 Turn release messages sent to autorelease pools into drain messages. No
functionality change in non-GC mode, in GC mode it invokes a quick GC pass to
try to delete the short-lived objects.

Also deleted some [pool release] lines just before exit() or return-from-main
statements.  These cause objects to be swapped in and destructors to be run to
no benefit (the OS will reclaim this memory without requiring stuff to be
swapped in when the process exits).



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33146 72102866-910b-0410-8b05-ffd578937521
2011-05-27 12:42:37 +00:00
Eric Wasylishen
346f604cb7 * Source/NSWindow.m: Remove unnecessary FIXMEs related to
user space scale factor
* Source/NSAppliation.m: Correct app icon sizing which was
mixing up window frame coordinates and user space coordinates
* Source/NSCachedImageRep.m: Add NSUnscaledWindowMask to the
window used internally


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32897 72102866-910b-0410-8b05-ffd578937521
2011-04-19 08:23:01 +00:00
Germán Arias
2466b5cf58 Miniaturize all windows if the AppIcon is suppressed
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32740 72102866-910b-0410-8b05-ffd578937521
2011-03-29 18:26:11 +00:00
Fred Kiefer
b7d056ae43 Removed dead assignments found by static code analyser.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32551 72102866-910b-0410-8b05-ffd578937521
2011-03-13 15:26:20 +00:00
Fred Kiefer
2d01942e4b Replace #include -> #import
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32451 72102866-910b-0410-8b05-ffd578937521
2011-03-04 11:33:22 +00:00
Wolfgang Lux
e8de70e645 Add user default to allow placing app icons and mini windows at normal
window level. This is particularly convenient with some window
managers (*cough*, kwin) where application and pop up menus would be
obscured by dock level windows.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32165 72102866-910b-0410-8b05-ffd578937521
2011-02-14 22:25:57 +00:00
Wolfgang Lux
3da944c1dd Fix application termination behavior by sending a message to the
document controller to let the user review any unsaved changes in its
managed documents before asking the application delegate whether its
okay to terminate the application. This matches Cocoa's documented and
implemented behavior.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31957 72102866-910b-0410-8b05-ffd578937521
2011-01-27 20:32:01 +00:00
Wolfgang Lux
92601d85d8 Look up key equivalents in the Services menu only after traversing
rest of the main menu to avoid accidentally shadowing key equivalents
in the application's own menus.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31902 72102866-910b-0410-8b05-ffd578937521
2011-01-17 09:02:30 +00:00
Gregory John Casamento
fd4d577fa7 * Source/NSApplication.m: Added overide for orderWindow:relativeTo:
in NSIconWindow.  Check for GSSuppressAppIcon and order the window
	ONLY if the app icon window is supposed to be displayed, otherwise
	do not do anything with it.   I observed issues with this
	functionality while testing the GNOME theme the app icon would 
	periodically show even when the default mentioned above was set to 
	YES.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31898 72102866-910b-0410-8b05-ffd578937521
2011-01-16 05:22:10 +00:00
Germán Arias
f999016f34 Applied changes in menuInWindow.patch
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31895 72102866-910b-0410-8b05-ffd578937521
2011-01-16 00:32:54 +00:00
Wolfgang Lux
ba39755f4a Provide a default context menu for application icons when using
Macintosh or Windows 95 style menus. Inspired by OS X, the menu
contains items to hide or show the application, to terminate the
application, an item for each window present in the application's
window menu, and the items of the dock menu returned by the
application delegate.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31892 72102866-910b-0410-8b05-ffd578937521
2011-01-15 14:36:38 +00:00
Wolfgang Lux
9464856dfe Insert window menu items strictly at the bottom of the menu, keeping
only items with actions -performMiniaturize: and -performClose:
beneath them. This allows having additional items at the top of the
menu and works better for window menus that follow the Mac OS X UI
guidelines and have miniaturize and zoom commands at the top and
arrange in front below them.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31891 72102866-910b-0410-8b05-ffd578937521
2011-01-15 14:19:24 +00:00
Germán Arias
bf270ebcfb Fixed the behaviour of menu in window when hide the app
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31859 72102866-910b-0410-8b05-ffd578937521
2011-01-09 06:10:02 +00:00
Wolfgang Lux
90dc44a8f6 Don't make an invisible window main window in NSApplication
-finishLaunching when the application has no main window.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31715 72102866-910b-0410-8b05-ffd578937521
2010-12-07 08:00:43 +00:00
Wolfgang Lux
4e19857788 Open a new document when a document based application is launched if
the delegate responds YES to applicationShouldOpenUntitledFile: but
does not implement applicationOpenUntitledFile:.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31506 72102866-910b-0410-8b05-ffd578937521
2010-10-13 13:36:44 +00:00
Fred Kiefer
d08b23d9b0 First batch of corrections based on David's static analysis.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31337 72102866-910b-0410-8b05-ffd578937521
2010-09-12 16:34:22 +00:00
Eric Wasylishen
26fcda321b Replace sel_eq with sel_isEqual
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31285 72102866-910b-0410-8b05-ffd578937521
2010-09-09 23:50:38 +00:00
Wolfgang Lux
b2311f4138 Change the Arrange in Front command to order only the application's
non-miniaturized windows front and not deminiaturize any miniaturized
windows.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31103 72102866-910b-0410-8b05-ffd578937521
2010-08-09 21:03:20 +00:00
Wolfgang Lux
8b3c88167f Do not attempt to open an untitled document upon launching a document
based application that does not define an editor type.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30535 72102866-910b-0410-8b05-ffd578937521
2010-06-01 21:36:51 +00:00
Fred Kiefer
99e273a57d few compiler warning fixes plus a lot of #import replacement.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30448 72102866-910b-0410-8b05-ffd578937521
2010-05-24 10:48:14 +00:00
Gregory John Casamento
3cdbf7591f * Source/NSApplication.m: Attempt to open files from the command
line, if possible in -finishLaunching.  This matches the behavior
	seen on OpenStep and on Mac OS X/Cocoa.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30407 72102866-910b-0410-8b05-ffd578937521
2010-05-17 08:29:55 +00:00
Quentin Mathe
5285361395 Moved the main Nib file loading from -finishLaunching to NSApplicationMain() in
order to match Cocoa behavior/documentation.

This makes easier to implement a custom AppKit main that works with both Cocoa 
and GNUstep.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30398 72102866-910b-0410-8b05-ffd578937521
2010-05-16 13:56:50 +00:00
Doug Simons
ce29b8d726 protect changedMessagesEnabled flag; update menus after modal session, key or main window change
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29891 72102866-910b-0410-8b05-ffd578937521
2010-03-09 23:11:40 +00:00
Fred Kiefer
c05581a005 Fix up teh includes to compile again after latest changes to base. Still
plenty of warnings and the result isn't working at least on 64 bit
machines :-(


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29685 72102866-910b-0410-8b05-ffd578937521
2010-02-20 10:40:44 +00:00
Fred Kiefer
43074e4a62 Start cleanup after big base change. Remove the usage of extension
methods.
New 10.5 methods on NSCell.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29656 72102866-910b-0410-8b05-ffd578937521
2010-02-17 09:58:38 +00:00
Wolfgang Lux
1ace430690 Send -applicationShouldTerminateAfterLastWindowClosed: to the delegate
only after a short delay so that all observers can process the
NSWindowWillCloseNotification. This ensures that a modified document
associated with the closed window has been closed before -terminate:
is called and therefore the user isn't asked twice whether she wants
to save the unsaved changes.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29428 72102866-910b-0410-8b05-ffd578937521
2010-01-28 00:10:42 +00:00
Quentin Mathe
dc80819ab4 Dispatch drag events with -[NSApp sendEvent:] and make each synthetized drag
event the current event in order to be consistent with Mac OS X behavior.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29418 72102866-910b-0410-8b05-ffd578937521
2010-01-27 11:21:13 +00:00
Gregory John Casamento
205498d887 * Source/NSApplication.m: For hide: perform miniaturizeAll:
on Windows, since hiding the app causes it to be inaccessible on 
	that platform.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29281 72102866-910b-0410-8b05-ffd578937521
2010-01-14 12:06:35 +00:00
Fred Kiefer
fc783c92d6 Patch by German Arias <german@xelalug.org>.
Allows to get icon placement from separate process.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29153 72102866-910b-0410-8b05-ffd578937521
2009-12-21 17:27:56 +00:00
Riccardo Mottola
cacdad6f44 Only add windows that are either visible or miniaturized.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29117 72102866-910b-0410-8b05-ffd578937521
2009-12-12 10:10:40 +00:00
Richard Frith-MacDonald
8a7cfaf918 fix drawing bug when number of rows decreases
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29065 72102866-910b-0410-8b05-ffd578937521
2009-11-26 20:33:44 +00:00
David Chisnall
bf300b6950 Replaced two superfluous NSInvocation construction occurrences with direct calls to the IMP in question. According to Riccardo 'it is really snappier in most user operations'.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29050 72102866-910b-0410-8b05-ffd578937521
2009-11-23 23:01:23 +00:00
Richard Frith-MacDonald
a518eeea1c revert accidental change
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29045 72102866-910b-0410-8b05-ffd578937521
2009-11-20 13:43:02 +00:00
Richard Frith-MacDonald
47f9930e07 tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29044 72102866-910b-0410-8b05-ffd578937521
2009-11-20 13:36:46 +00:00
Fred Kiefer
2da5479a9e Small change for bug #27309 and a helper function for GSTaskBar.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28974 72102866-910b-0410-8b05-ffd578937521
2009-11-08 16:12:04 +00:00
Fred Kiefer
2cd86dee14 Only set the current event when dequeuing and never return the
null_event.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28938 72102866-910b-0410-8b05-ffd578937521
2009-11-02 12:13:59 +00:00
Richard Frith-MacDonald
1c8cd6a0c4 Fixups to avoid crashes opening non-document-based apps.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28844 72102866-910b-0410-8b05-ffd578937521
2009-10-19 10:03:03 +00:00
Richard Frith-MacDonald
d2e616cb73 minor fixups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28843 72102866-910b-0410-8b05-ffd578937521
2009-10-19 07:44:22 +00:00
Richard Frith-MacDonald
161d6e03e7 fix for activation with suppressed icon window
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28837 72102866-910b-0410-8b05-ffd578937521
2009-10-18 08:02:40 +00:00
Wolfgang Lux
d2f51e9cde When using MS Windows style menus terminate an application by default
when its last window is closed.
In addition, fix a bug where the application was not terminated when
the last window is closed while the application is in the background.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28834 72102866-910b-0410-8b05-ffd578937521
2009-10-17 17:09:36 +00:00
Wolfgang Lux
65f8f0a588 Improve compatibility with Mac OS X and open a new document by default
when a document based application is started and there is no file to
open.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28833 72102866-910b-0410-8b05-ffd578937521
2009-10-17 17:01:24 +00:00
Richard Frith-MacDonald
c72cc49307 Partial code for using miniaturised app icon to unhide a hidden app.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28832 72102866-910b-0410-8b05-ffd578937521
2009-10-17 15:18:26 +00:00
Richard Frith-MacDonald
11ad2da52b Suppress app icon window by simply not ordering it in.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28831 72102866-910b-0410-8b05-ffd578937521
2009-10-17 05:35:56 +00:00
Sheldon Gill
32c94cae17 Centralise GSGuiBundle() routine
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28830 72102866-910b-0410-8b05-ffd578937521
2009-10-17 05:05:35 +00:00
Sheldon Gill
24a12e840f Move defaultExceptionHandler initialisation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28829 72102866-910b-0410-8b05-ffd578937521
2009-10-17 04:56:22 +00:00
Fred Kiefer
2c18d466d2 Use NSModalPanelRunLoopMode instead of NSDefaultRunLoopMode.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28815 72102866-910b-0410-8b05-ffd578937521
2009-10-12 18:29:41 +00:00