Commit graph

53 commits

Author SHA1 Message Date
Sergii Stoian
2a1b9d4d54 * Source/NSWindow.m (sendEvent:): set current screen to ivar and
send WindowDidChangeScreen notification if window was moved to other
  screen.

* Source/NSScreen.m (mainScreen): returns screen of main menu if no
  key window exists. With this implementation default screen (screen at
  index 0 in screens array) should never be returned.

* Source/NSMenu.m (initWithTitle:): observe WindowDidBecomeKey and
  WindowDidChangeScreen notifications.
  (windowDidChangeScreen:): new method to handle observed notification
  added above. Moves menu to screen of key window for both cases: when
  key window moved to or activated on different screen.
2020-02-12 01:46:17 +02:00
Sergii Stoian
a4174f2838 * Source/NSWindow.m (applicationDidChangeScreenParameters): take into
account screen origin change during window position recalculation.

* Source/NSScreen.m (dealloc): debug output was removed.
2020-01-27 00:47:08 +02:00
Sergii Stoian
d4ea1a490f * Source/NSWindow.m (initWithContentRect:styleMask:backing:defer:):
added observer of NSApplicationDidChangeScreenParametersNotification.
  (applicationDidChangeScreenParameters:): callback for added notification -
  updates window position, set new screen object and saves frame if
  autosave name exists.

* Source/NSScreen.m (initialize): remove observer of
  NSApplicationDidChangeScreenParametersNotification - NSScreen shouldn't
  do it. Backend explicitely calls -resetScreens before posting notification.
  (_initWithScreenNumber:): ditto.
  (_resetScreens): removed.
  (deviceDescription): removed duplicated addition of NSDeviceSize object.

* Source/NSApplication.m (finishLaunching): remove observer of
  NSApplicationDidChangeScreenParametersNotification.
2020-01-26 03:13:16 +02:00
Sergii Stoian
731abde796 * Source/NSScreen.m (_initWithScreenNumber:): add self as observer to
NSApplicationDidChangeScreenParametersNotification.
(frame): use `_frame` ivar since libs-back recreates screens list.
(dealloc): remove observer.
(applicationDidChangeScreenParameters:): update _frame and _depth
ivars for bad behaving objects which retain NSScreen and not observing
screen parameters changes.
2020-01-24 19:48:28 +02:00
Sergii Stoian
41dc7fa9cd Fixed permissions. 2020-01-23 13:57:42 +02:00
Sergii Stoian
232b70967a * Source/NSScreen.m (dealloc): removed unneeded -removeObserver call. 2020-01-23 12:51:51 +02:00
Sergii Stoian
50b7d772c2 * Source/NSScreen.m: retrun back accedentially removed comment. 2020-01-23 12:49:25 +02:00
Sergii Stoian
211d9bcc46 * Source/NSScreen.m (frame): removed extra semicolon. 2020-01-23 12:47:17 +02:00
Sergii Stoian
fbc08684f4 * Source/NSMenu.m (_initWithScreenNumber:): removed observer for
NSApplicationDidChangeScreenParametersNotification.
  (_updateScreenInfo:): removed obsever action.
  (frame): get screen diension from display server (-boundsForScreen)
  to get actual numbers.
2020-01-23 02:08:55 +02:00
Sergii Stoian
b3113cd66f * Source/NSScreen.m: (_initWithScreenNumber): observe notification from
baackend on screen changes (display resolution).
* Source/NSScreen.m: (_updateScreenInfo): initial implementation.
2020-01-22 19:15:57 +02:00
fredkiefer
7270f8efc7 Add new backingScaleFactor method on NSScreen. 2017-12-03 22:02:06 +01:00
Fred Kiefer
ac6909e871 Merged changes from gnustep_testplant_branch branch and cleaned them up
a bit.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35417 72102866-910b-0410-8b05-ffd578937521
2012-08-17 13:16:12 +00:00
Eric Wasylishen
48f0fd951c * Source/NSScreen.m (-userSpaceScaleFactor): Use the DPI
from the display server instead of ignoring it and assuming 72.

The X11 server was changed to always return 72 for now, so there
is no change in behaviour on X.

On Windows we do use the system DPI/scale factor now.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33659 72102866-910b-0410-8b05-ffd578937521
2011-07-30 20:44:06 +00:00
Eric Wasylishen
ce051d9bd8 * Source/NSScreen.m: Use -userSpaceScaleFactor to calculate
NSDeviceResolution
* Source/NSImage.m: Implement -_bestRep:withResolutionMatch:
* Images/common_Dimple.tiff:
* Images/common_3DArrowRight.tiff: Add to these images
a second 'page' at 4x the original resolution which I drew.

If you use GSScaleFactor > 1 then the high resolution version
of these images should be used.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32975 72102866-910b-0410-8b05-ffd578937521
2011-05-04 01:33:21 +00:00
Eric Wasylishen
d92c92984d * Source/NSScreen.m: Read -userSpaceScaleFactor from the GSScaleFactor
user default.
* Source/GSWindowDecorationView.m: Apply -[NSScreen userSpaceScaleFactor]
in +frameRectForContentRect and +contentRectForFrameRect, as well as
setting a scaled bounds size in -layout.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32898 72102866-910b-0410-8b05-ffd578937521
2011-04-19 08:42:59 +00:00
Eric Wasylishen
b4e8ecd7cf * Source/NSScreen.m (-userSpaceScaleFactor):
Temporarily fix the scale factor at 1.0 until the remaining parts
of the high DPI patch are committed.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32896 72102866-910b-0410-8b05-ffd578937521
2011-04-18 23:21:11 +00:00
Fred Kiefer
d83fb0774b Remove direct usage of isa.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32248 72102866-910b-0410-8b05-ffd578937521
2011-02-20 18:24:44 +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
Richard Frith-MacDonald
907b7a60e1 Small bugfix and performance optimisation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27735 72102866-910b-0410-8b05-ffd578937521
2009-01-30 16:27:36 +00:00
Adam Fedor
7afdd32ac1 Revert library license version to 2 until applications can be converted
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26619 72102866-910b-0410-8b05-ffd578937521
2008-06-10 04:01:49 +00:00
Fred Kiefer
193e31e678 Change all files to use GPL 3 and LGPL 3.
Prepare for next release.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25536 72102866-910b-0410-8b05-ffd578937521
2007-10-29 21:16:17 +00:00
Fred Kiefer
7a9639a359 Implement userSpaceScaleFactor plus general cleanup.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25382 72102866-910b-0410-8b05-ffd578937521
2007-08-08 08:04:11 +00:00
Richard Frith-MacDonald
17d346b3e5 Window frame handling fixups (bug #17377)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23399 72102866-910b-0410-8b05-ffd578937521
2006-09-06 11:29:20 +00:00
Richard Frith-MacDonald
c2d4e58fb5 Allow for mac style horizontal menu. Also minor code style fixups.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22598 72102866-910b-0410-8b05-ffd578937521
2006-03-05 13:21:33 +00:00
Gregory John Casamento
4597358562 Corrected problem reported cbv.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22563 72102866-910b-0410-8b05-ffd578937521
2006-02-23 04:04:22 +00:00
Adam Fedor
303dd1baf9 Update FSF Address.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21259 72102866-910b-0410-8b05-ffd578937521
2005-05-26 02:52:46 +00:00
Gregory John Casamento
0f64c6ffed Documentation and prevention of a leak in case of exception.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18302 72102866-910b-0410-8b05-ffd578937521
2004-01-02 04:19:32 +00:00
David Ayers
b18f1c4ac4 Header reorganization - Please refer to ChangeLog
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17408 72102866-910b-0410-8b05-ffd578937521
2003-07-31 23:52:10 +00:00
Adam Fedor
6be9174933 Include <> -> ""
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16917 72102866-910b-0410-8b05-ffd578937521
2003-06-13 15:01:12 +00:00
Adam Fedor
cce683f608 Printing impl.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14862 72102866-910b-0410-8b05-ffd578937521
2002-10-29 02:48:16 +00:00
Adam Fedor
6d269aec7d New mouselocation methods
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13530 72102866-910b-0410-8b05-ffd578937521
2002-04-23 20:50:24 +00:00
Adam Fedor
955aa35094 Split into Window server and graphic context handling
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13256 72102866-910b-0410-8b05-ffd578937521
2002-03-28 03:53:18 +00:00
Fred Kiefer
919986d571 [deviceDescription] call new function GSResolutionForScreen.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11859 72102866-910b-0410-8b05-ffd578937521
2001-12-21 00:49:37 +00:00
Adam Fedor
d47e202fbe Markup for autogsdoc
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11788 72102866-910b-0410-8b05-ffd578937521
2001-12-17 16:51:51 +00:00
Fred Kiefer
8e59dbb8ca Removed function _screenNumbers. Moved class method to front. Use
[screens] in method [mainScreen]. Cache screens in mehtod
[screens]. Use the context from NSApp instead of the current
context in all calls. In [deepestScreen] replace NSScreen by self.
Added method [resetScreens].


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11104 72102866-910b-0410-8b05-ffd578937521
2001-10-07 22:47:00 +00:00
Adam Fedor
1ff4d1c990 Load backend as a bundle.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@9580 72102866-910b-0410-8b05-ffd578937521
2001-04-13 20:04:04 +00:00
Adam Fedor
144ab50f30 Fix translation of scrolling document bounds
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8042 72102866-910b-0410-8b05-ffd578937521
2000-11-06 05:00:17 +00:00
Richard Frith-MacDonald
7cf5df31ea NSScreen fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6560 72102866-910b-0410-8b05-ffd578937521
2000-05-04 18:28:00 +00:00
Adam Fedor
004b020700 Autorelease some vars
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6516 72102866-910b-0410-8b05-ffd578937521
2000-04-25 21:20:52 +00:00
Richard Frith-MacDonald
44945db528 colorspace support
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6515 72102866-910b-0410-8b05-ffd578937521
2000-04-25 20:26:51 +00:00
Richard Frith-MacDonald
185ed4ed38 Menu location save/restore fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5685 72102866-910b-0410-8b05-ffd578937521
2000-01-07 16:46:35 +00:00
Adam Fedor
4f1dbcfbe8 More imaging and compositing stuff
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5635 72102866-910b-0410-8b05-ffd578937521
1999-12-28 19:20:45 +00:00
Adam Fedor
97eb87a61c Remove obsolete backend classes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5101 72102866-910b-0410-8b05-ffd578937521
1999-10-29 18:43:48 +00:00
Adam Fedor
43faeba934 Update for MacOSX
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4895 72102866-910b-0410-8b05-ffd578937521
1999-09-14 21:40:29 +00:00
Adam Fedor
a697248374 Updating xdps backend
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4083 72102866-910b-0410-8b05-ffd578937521
1999-04-15 04:47:54 +00:00
Adam Fedor
81abcf1f75 Change backend initialization
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3428 72102866-910b-0410-8b05-ffd578937521
1998-12-10 19:53:41 +00:00
Felipe A. Rodriguez
4dd58372f6 * move DPSOperators.h to XDPS.
* move GPS headers into a new backend.
	* define GSContext.h/GSContext.m as abstract super for all drawing
		destinations (eliminates the need for DPS, GPS, DGS at the root of
		the AppKit) add appropriate defintion to various classes.
	* NSMatrix.m add abstract backend code from xraw (eliminate backend).
	* NSSlider.m add abstract backend code from xraw (eliminate backend).
	* NSSliderCell.m add abstract backend code from xraw (eliminate backend).
	* NSSplitView.m add abstract backend code from xraw (eliminate backend).
		replace private divider highlight method with NSHighlightRect()
	* NSWindow.m add class method to create backend specific window view.
	* NSTextField.m add abstract backend code from xraw (eliminate backend).
	* NSForm.m add abstract backend code from xraw (eliminate backend).
	* NSFormCell.m add abstract backend code from xraw (eliminate backend).
	* NSColorWell.m add abstract backend code from xraw (eliminate backend).
	* NSButton.m add abstract backend code from xraw (eliminate backend).
	* NSControl.m add abstract backend code from xraw (eliminate backend).
	* NSBox.m add abstract backend code from xraw (eliminate backend).
	* NSBrowser.m add abstract backend code from xraw (eliminate backend).
	* NSBrowserCell.m add abstract backend code from xraw (eliminate backend).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3321 72102866-910b-0410-8b05-ffd578937521
1998-11-25 17:16:48 +00:00
Scott Christley
aee90a695e Convert to the GNUstep makefile package.
The config.h files should not be installed with the other
header files; it is only used for compilation, so the source
files should include it not the header files.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2439 72102866-910b-0410-8b05-ffd578937521
1997-09-23 22:43:24 +00:00
Scott Christley
b78cc8a51f Add WIN32 DLL support
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2367 72102866-910b-0410-8b05-ffd578937521
1997-08-04 20:42:56 +00:00
Scott Christley
151bf11e2c Header files reorganized. All the definitions were moved in appropiate files.
Each header file includes only the header files it needs and it uses
@class to forward reference a class.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2189 72102866-910b-0410-8b05-ffd578937521
1997-02-18 00:29:25 +00:00