to hold Xlib screen size dimensions.
* Source/x11/XGServerWindow.m:
(_OSFrameToXFrame:for:): use xScreenSize instead of DisplayHeight.
(_OSFrameToXHints:for:): ditto.
(_XFrameToOSFrame:for:): ditto.
(movewindow::): ditto.
(_screenSize): new static function to get dimensions of Xlib screen from
root window.
(screenList): use xScreenSize instead of DisplayHeight/DisplayWidth.
origin into unflipped (OpenStep) coordinate system for XRandR capable
systems. After this change windows and screen will use the same start
of coordinate system for their origins.
screen height instead of monitor's because we convert coordinates
from Xlib area.
(movewindow::): use Xlib screen height because we're operating in
Xlib coordinate system.
(screenList): fill monitor depth with value returned by
windowPathForScreen with monitor at index 0 (screen_id already set so
method will get correct screen_id).
* Source/x11/XGServerEvent.m (processEvent:): fixed indentaion.
(_OSFrameToXHints:for:): use Xlib screen height instead of monitor's
because we convert coordinates to Xlib area.
* Source/x11/XGServerEvent.m (processEvent:): update monitor_id from
NSWindow's screen number (it could change after event processing).
(mouseLocationOnScreen🪟): use Xlib screen height instead of
monitor's. Added comment to code that should be probably removed
later.
explicit and removed additional copy before calling this function.
This function should now do what the comment above it says.
(alphaMaskForImage): Slightly cleaner code.
with monitor index, not screen ID (screen_id field has already set
to defScreen above).
(windowDepthForScreen:): get Xlib screen with screen_id from monitor
lit.
`screen_id`; `monitor_id` element was added. Made use of
`screen_id` and `monitor_id` where it's appropriate.
* Removed `screen` parameter from methods which contains it in name.
Methods were renamed to remove `Screen` and `FromScreen`.
* Source/x11/XGServerWindow.m (screenList): change with assumption
that Xlib screen is one per application.
Failback code to RandR-related always creates arrays with one element
(no enumeration needed). Create `monitor` structure in failback (non-RandR)
code. Use `screen_id` MonitorDevice structure element to hold Xlib screen
ID.
(windowDepthForScreen:): assume that `screen` parameter is a Xlib screen ID,
simplify code - `screen` will be used with RandR or not.
(availableDepthsForScreen:): changed with assumption that `screen` is a index
of element in `monitors` structure.
* Source/x11/XGServer.m (_initXContext): initialize `monitors` array
early here before first use (calls to XGServerWindow methods).
code. Failback to Xlib generic method if any no RandR available or
RandR function call was unsuccessful. In Xlib generic method fill in
monitors array with values.
(boundsForScreen:): use values from cached `monitors` array since
-screenList fills it on both cases with or without RandR available.
`monitors` array items.
* Source/x11/XGServerWindow.m: use `monitorsCount` instead of local
variable `count` or ScreenCount() value.
* ChangeLog: update to the latest changes.
Mark methods where usage of X Screen as parameter is correct and where isn't.
-boundsForScreen: to get correct screen dimensions if RandR is supported.
(_OSFrameToXHints:for:): ditto.
(_XFrameToOSFrame:for:): ditto.
(movewindow::): ditto.
(windowbounds:): ditto.
(setMouseLocation:onScreen:): ditto.
* Source/x11/XGDragView.m: ditto.
* Source/x11/XGServerEvent.m (processEvent:): destroy NSScreen screens
list to be regenereated on next call. This change updates ivars of
NSScreen (_frame, _depth) by recreating NSScreen instances.
(mouseLocationOnScreen🪟): use -boundsForScreen: to get correct
screen dimensions if RandR is supported.
ivars were added.
* Source/x11/XGServer.m (_initXContext): get RandR event and error base.
* Source/x11/XGServerEvent.m (processEvent:): pack several RandR events
into one notification post.
enabled get screen dimensions using Xrandr objects.
* Source/x11/XGServerEvent.m (processEvent:): process Xrandr event and
send NSApplicationDidChangeScreenParametersNotification.
* Source/x11/XGServer.m (_initXContext): subscribe to the Xrandr event.