Commit graph

1274 commits

Author SHA1 Message Date
Fred Kiefer
6923a62820
Merge pull request #21 from gnustep/randr
Align screens origin to OpenStep coordinate system.
2020-02-11 23:19:17 +01:00
Sergii Stoian
230006323d * Source/x11/XGServerWindow.m (screeList): remove usage of intermediate frame variable. 2020-02-11 23:56:39 +02:00
Sergii Stoian
2fdced823c Merge branch 'master' into randr
Conflicts:
	ChangeLog
	Source/x11/XGServerWindow.m
2020-02-11 23:38:52 +02:00
Sergii Stoian
9c4f9ce7fc * Source/x11/XGServerWindow.m (screenList): Transform screen
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.
2020-02-11 18:21:34 +02:00
fredkiefer
2c99cfc730 Fixes after Xrandr change to get xlib backend to compile again. 2020-02-08 21:30:54 +01:00
fredkiefer
f9d3dd7f96 * Source/x11/XGServerWindow.m (screenList): Clean up implementation. 2020-02-08 13:35:43 +01:00
Sergii Stoian
74bab329ba
Merge pull request #19 from gnustep/randr
Screens handling with RandR fixes
2020-02-08 02:51:58 +02:00
Sergii Stoian
519d267d60 * Source/x11/XGServerWindow.m (resolutionForScreen:): fixed parameter
name in comment.
2020-02-08 01:54:18 +02:00
Sergii Stoian
e6108e05f7 * Source/x11/XGServerWindow.m (_XFrameToOSFrame:for:): use Xlib
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.
2020-02-07 19:00:27 +02:00
Sergii Stoian
bcf71f2302 Merge remote-tracking branch 'origin/master' into randr
Conflicts:
	ChangeLog
	Source/x11/XGServerWindow.m
2020-02-07 16:30:52 +02:00
Sergii Stoian
82931a4a61 * Source/x11/XGServerWindow.m (_OSFrameToXFrame:for:):,
(_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.
2020-02-07 16:01:03 +02:00
fredkiefer
c79b2a7b09 * Source/x11/XGServerWindow.m (swapColors): Made code more
explicit and removed additional copy before calling this function.
This function should now do what the comment above it says.
(alphaMaskForImage): Slightly cleaner code.
2020-02-07 10:13:48 +01:00
Sergii Stoian
84ec2f0110 * Source/x11/XGServerWindow.m (screenList): do not create monitors as
sparse array. This is usefull when -boundsToScreen: called with paramter
  value `0` and there is no monitor connected to first RandR ouput.
2020-02-04 02:45:14 +02:00
Sergii Stoian
1065e45869 * Source/x11/XGServerWindow.m (screenList): fixed comment.
(resolutionForScreen:): parameter renamed.
2020-02-03 23:25:03 +02:00
Sergii Stoian
6a1c1600a2 * Source/x11/XGServerWindow.m (screenList): insert primary (main)
monitor index into index 0 of returned array.
2020-02-03 18:24:54 +02:00
Sergii Stoian
e3da99fb5e * Source/x11/XGServerWindow.m (screenList): call windowDepthForScreen:
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.
2020-02-03 15:27:40 +02:00
Sergii Stoian
904739eb0c * Source/x11/XGServerWindow.m (screenList): update comment.
(nativeWindow:::::): assign `*screen` to `screen_id`, `monitor_id` is
set to `0`.
2020-02-03 14:29:25 +02:00
Sergii Stoian
87da2f0a28 * Source/x11/XGServer.m: use #pragma clang only if clang
compiler is used.
2020-02-03 13:56:18 +02:00
Sergii Stoian
8b66164d88 * Source/x11/XGServer.m (getForScreen:pixelFormat:masks:::):
removed unused code.
2020-02-03 13:31:27 +02:00
Sergii Stoian
c1ab242c9e * gswindow_device_t structure element screen was renamed to
`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).
2020-02-03 01:21:52 +02:00
Sergii Stoian
3e53e04c58 * Source/x11/XGServerWindow.m (screenList): join RandR and non-RandR
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.
2020-01-31 19:28:32 +02:00
Sergii Stoian
022a988e97 * Source/x11/XGServerWindow.m (boundsForScreen:): check for number of
XRandR's ouputs.
2020-01-31 18:59:49 +02:00
Riccardo Mottola
ae3510f385 Check if Xrandr did not succeed and provide fallback. 2020-01-31 16:29:01 +01:00
Sergii Stoian
7e6dfa39e8 * Source/x11/XGServerWindow.m (screenList): fixed missed rename count
into `monitorsCount` on non-RandR code.
2020-01-30 14:08:59 +02:00
Sergii Stoian
c4631e0fc3 * Source/x11/XGServerWindow.m:
(windowDepthForScreen:): renamed method parameter; append `x_` prefix to
  `Screen *` internal variable; validate `screen` parameter value; use
  `defScreen` for RandR enabled code.
  (availableDepthsForScreen:): ditto.
  (resolutionForScreen:): renamed method parameter; validate `screen`
  parameter value.
  (boundsForScreen:): renamed method parameter.
2020-01-30 13:58:34 +02:00
Sergii Stoian
66f1e75c50 ChangeLog: fix date in last change. 2020-01-30 01:29:56 +02:00
Sergii Stoian
62bef72ac0 * Headers/x11/XGServer.h: monitorsCount ivar was added to hold
`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.
2020-01-30 01:27:11 +02:00
Sergii Stoian
7ebd2468b1 * Headers/x11/XGServer.h,
* Source/x11/XGServer.m,
* Source/x11/XGServerWindow.m: hold the cache of connected monitor devices
  parameters - `monitors` - a an array structures.
2020-01-29 19:23:52 +02:00
Sergii Stoian
88bc2a4efd
Merge pull request #18 from gnustep/randr
Dynamic screen resolution change support
2020-01-29 14:55:09 +02:00
Sergii Stoian
f38d8a33bd * Source/x11/XGServerEvent.m (processEvent:): add space after comma in
XSync call.
* Source/x11/XGServerWindow.m (boundsForScreen:): use NSZeroRect.
2020-01-28 12:04:03 +02:00
Sergii Stoian
8d9223aa1e Merge branch 'randr' of https://github.com/gnustep/libs-back into randr 2020-01-28 11:53:11 +02:00
Sergii Stoian
6947c49951 * Headers/x11/XGServer.h: split RandR variables defintion into separate
lines.
2020-01-28 11:52:24 +02:00
Fred Kiefer
f0395f07ce
Merge branch 'master' into randr 2020-01-27 23:19:03 +01:00
Sergii Stoian
b5c563a400 * Source/x11/XGServerWindow.m (boundsForScreen:): use screen variable
to identify output in RandR screen resources. Use `boundsRect` local
  variable as return vaalue storage. Cleanup.
2020-01-26 23:56:00 +02:00
Sergii Stoian
111add7ec2
Merge pull request #16 from trunkmaster/master
Clang warnings fix for ART backend
2020-01-26 22:52:55 +02:00
Sergii Stoian
72284c1d37 * Source/art/ftont-old.m: is unused, so removed. 2020-01-26 22:51:22 +02:00
Sergii Stoian
78a5f6a380 * Source/x11/XGServerEvent.m (processEvent:),
* Source/x11/XGServer.m (_initXContext): catch and process RandR event
  on default screen.
2020-01-26 02:55:34 +02:00
Sergii Stoian
7f24ad7d89 * Source/x11/XGServerWindow.m (_OSFrameToXFrame:for:): use
-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.
2020-01-24 19:43:09 +02:00
Sergii Stoian
64335397b5 * Headers/x11/XGServer.h (GSDisplayServer): RandR event and error base
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.
2020-01-23 19:03:34 +02:00
Sergii Stoian
501c6eb018 * Source/x11/XGServerWindow.m (boundsForScreen:): if Xrandr support
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.
2020-01-23 02:02:52 +02:00
Sergii Stoian
2085ea4a9a * configure.ac: check for availability of Xrandr library.
* config.h.in: added default value for Xrandr usage.
* configure: regenerate.
2020-01-22 12:58:17 +02:00
Marcus Müller
df63d305ac Fix ALPHA_THRESHOLD typo 2020-01-21 23:59:26 +01:00
Sergii Stoian
19a68d2d85 * Source/art/ftfont.m: removed commented out #include and #include
moved into ftfont.h.
2020-01-19 01:31:21 +02:00
Sergii Stoian
2657c4437c * Source/art/shfill.m:,
* Source/art/path.m:,
* Source/art/image.m (DPSimage:::::::::::):
  fixed type formatting specifiers.

* Source/art/ftfont.m: removed include to ftfont-old.m.
  (drawString:at::to::::::::color::::transform:deltas:::widthChar:drawinfo:):,
  (drawGlyphs::at::to::::::color::::transform:drawinfo:):,
  (drawGlyphs::at::to::::::alpha::color::::transform:drawinfo:):,
  (bezierpath_funcs):,
  fixed type formatting specifiers; moved interface declaration of FTFontInfo
  to ftfont.h; removed GCCism.

* Source/art/ftfont.h: moved interface declaration of FTFontInfo here.
* Source/art/composite.m: fixed type formatting specifiers.
* Source/art/FTFontEnumerator.m (load_font_configuration): fixed type
  formatting specifiers.
2020-01-17 17:23:07 +02:00
Sergii Stoian
a890577b76
Merge pull request #15 from trunkmaster/master
TakeFocus request handling fix
2020-01-16 19:52:23 +02:00
Sergii Stoian
9cc708e9e8 * Source/x11/XGServerEvent.m (_handleTakeFocusAtom:forContext:): key_window
definition moved to the `if` block where it's used.
2020-01-16 19:47:48 +02:00
Sergii Stoian
a1f08ad8ca * Source/x11/XGServerEvent.m (_handleTakeFocusAtom:forContext:): tiny
formatting fix.
2020-01-16 11:44:28 +02:00
Sergii Stoian
4e5f2ddbb1 * Source/x11/XGServerEvent.m (_handleTakeFocusAtom:forContext:): use
`cWin` instead of `this_window`
* ChangeLog: updated.
2020-01-16 11:41:02 +02:00
Sergii Stoian
124a18f026 * Source/x11/XGServerEvent.m (_handleTakeFocusAtom:forContext:):
- use lowerCamelCase for objects and underscores for primitive types;
  - added and used `this_window` variable - represents window that has
    received TakeFocus event - instead of `cWin` (last used window by
    backend);
  - do not ignore TakeFocus request if now key window was set
    and if main application menu received request.
2020-01-16 00:54:34 +02:00
Sergii Stoian
09bf6067c2
Merge pull request #14 from trunkmaster/master
Correct application icon images in WM
2020-01-14 10:55:29 +02:00