Commit graph

1030 commits

Author SHA1 Message Date
rmottola
d5abf2ff1c actually store in a LONG_PTR the result of GetWindowLongPtr 2021-03-03 20:58:05 +01:00
rmottola
aad896a260 use consistently GetWindowLongPtr also for Cairo on Windows 2021-03-03 20:53:01 +01:00
rmottola
da9e53c608 upgrade consistently [Set,Get]WindowLong to [Set,Get]WindowLongPtr 2021-03-02 22:13:22 +01:00
Sergii Stoian
e5cdc1747b * Source/x11/XGServerWindow.m (_checkStyle:): do not set application
name and WindowGroupHint to temporary window. Created window designed
to help get window frame offsets only - appicon window will be created
later. This change prevents appicon flickering on WindowMaker at
application start.
(_createWMAppiconHack, _setupRootWindow): WindowMaker hack removed in
favour of solution introduced in _checkStyle:.
2021-01-27 15:37:27 +02:00
Sergii Stoian
3f3c1305a9 2021-01-24 Sergii Stoian <stoyan255@gmail.com>
* Source/x11/XGServerWindow.m: WindowMaker doesn't support
  _NET_REQUEST_FRAME_EXTENTS message andthe only way to determine offsets
  is creating and mapping window. In this case first mapped window of
  application is not appicon window.
  Early appicon creating inserted back as _createWMAppiconHack method and
  called only if no other way to determine window's offsets (before call to
  _checkStyle);appicon window size is set to size icon;
2021-01-24 02:45:29 +02:00
Sergii Stoian
0bbb7a0915 Author: Sergii Stoian <stoyan255@gmail.com>
--- log message follows this line --
* Source/x11/XGServerWindow.m: removed code commented out in
  previous commit.
2020-09-19 01:48:00 +03:00
Sergii Stoian
31b7c4ed2f * Source/x11/XGServerWindow.m
(_setupRootWindow, window::::): removed WindowMaker appicon hack and
  - now unused - _wmAppIcon variable.

  Description: The removed code removed creates and maps zero-sized
  window in hope that WindowMaker will recognize app by this event and
  create app icon window. Although when application requests window
  for appicon through the `-window::::` method call, it returns newly
  created and mapped window. This actually happens but application icon
  flickers between WM icon creation and application icon window appearance.

  This fix based on the fact that root application window (ROOT) is mapped
  in `-orderwindow:::` and this is the event of application recognition
  by WindowMaker because it is a first application window that is
  mapped.
2020-09-18 16:15:14 +03:00
Sergii Stoian
fa4549e522 * Source/x11/XGServerEvent.m (_handleTakeFocusAtom:forContext:):
space before argument was added.
2020-09-17 12:00:38 +03:00
Sergii Stoian
df32af71fc * Source/x11/XGServerEvent.m
(_handleTakeFocusAtom:forContext:): if application (window) receives
  WM_TAKE_FOCUS in hidden state it means WindowMaker wants us to be
  unhidden.

  Description: There are 2 protocols defined in XGServerWindow.h:
  WMFHideApplication and WMFHideOtherApplications. These protocols exist
  to help GNUstep application and WindowMaker notify each other
  about "Hide" and "Hide Others" actions. There are no protocols for
  "unhide" action.

  Test case steps:
  1. Open application with window opened.
  2. Hide application with "Hide" menu item.
  3. Open WindowMaker's "Windows" menu (middle-click on desktop).
  4. Select hidden application window.
  Application unhides, activates, restored window is focused (receives) input
  and "Hide" menu item unselected.
2020-09-17 01:42:32 +03:00
Sergii Stoian
d970554391 * Source/x11/XGServerWindow.m
(hideApplication:): send application's root window to WindowMaker (WM)
  because it's a "group leader" that clearly identifies application
  inside WM. WM uses XFindContext to get WApplication structure and
  "group leader" window ID is a key to find it.
2020-09-16 09:24:48 +00:00
Riccardo Mottola
95f8546eec Match return value in case of error (nil instead of NO) 2020-06-18 00:54:32 +02:00
fredkiefer
e929b48e0b * Headers/fontconfig/FCFaceInfo.h: Add instancevariable _patternIsResolved.
* Source/fontconfig/FCFaceInfo.m (-matchedPattern): Cache the
resolved pattern and return this. The method characterSet now uses
this cached pattern.
Patch by Josh Freeman <gnustep_lists@twilightedge.com>
2020-06-10 18:24:51 +02:00
Patrick Georgi
aebcc4b7fe Fix a bunch of typos
Taken from the Debian "gnustep-back" package sources, which attribute
these changes to:

Author: Eric Heintzmann <heintzmann.eric@free.fr>
Author: Yavor Doganov <yavor@gnu.org>
2020-05-29 08:21:55 +02:00
Ivan Vučica
bf4efe9d36
wayland: Added a small readme noting some backend-specific information. 2020-04-25 18:23:49 +01:00
Ivan Vučica
8f0cc1b0ca
wayland: Write down TODOs for cairo_surface doublebuffering to itself and for mouse wheel axis_source. 2020-04-25 18:12:43 +01:00
Ivan Vučica
f8b8609e70
wayland: Implement -[WaylandServer mouselocation]. 2020-04-25 18:12:42 +01:00
Ivan Vučica
67e352b83e
wayland: Deleted the useless override of -[GSDisplayServer windowlist]. 2020-04-25 18:12:42 +01:00
Ivan Vučica
c6e9ee857f
wayland: Support mouse middle click and smooth scroll wheel events. 2020-04-25 18:12:41 +01:00
Ivan Vučica
12f1d48772
wayland: Remove the 'fake drawing' branch. 2020-04-25 18:12:41 +01:00
Ivan Vučica
de9a8b36c3
wayland: Performed some investigation into freeing WaylandCairoSurface memory. 2020-04-25 18:12:40 +01:00
Ivan Vučica
b294b7f1b9
wayland: In case *stable* XDG Shell protocol isn't supported, be more informative.
The exception was not very informative about why exactly the
error message may occur. Weston in Debian buster doesn't
support the stable XDG Shell protocol, for instance, and
triaging this took some effort.
2020-04-25 18:12:40 +01:00
Ivan Vučica
84f71f5c3e
wayland: Additional interface registration NSDebugLog() output. 2020-04-25 18:12:39 +01:00
Ivan Vučica
359aa9e639
wayland: Additional clean up for license headers. 2020-04-25 16:14:07 +01:00
Ivan Vučica
41b2d294ed
wayland: Checking whether the surface is configured before committing.
This now results in windows being painted on the screen. However, input is
still ending up in all the wrong places, and there is a lot of garbage content
being painted outside the actual windows.

Right clicking on a window seems to trigger rotate behavior, which needs to
be evaluated and likely removed (or prevented, if this is done by Weston).

Interestingly, checking for ->configured on first surface commit also seems to
break the backend.
2020-04-17 01:19:26 +01:00
Ivan Vučica
36eefc981e
wayland: Assortment of fixes noticed during code review.
Rearranging order of the code, freeing some memory, writing a note
that additional work is required, returning a value through pointer
passed as argument, etc.
2020-04-15 00:36:37 +01:00
Ivan Vučica
80cc4121ae
wayland: Additional license header fixes noticed during PR. 2020-04-15 00:35:47 +01:00
Ivan Vučica
e8e615548a
wayland: Update license headers and copyright statement.
For contributions, we generally ask that copyright is assigned
to FSF. I believe this has been done by Sergio.
2020-04-15 00:19:53 +01:00
Ivan Vučica
3db7a6fbd4 wayland: Split the check for compositor and wm_base into two checks. 2020-04-15 00:00:40 +01:00
Ladislav Michl
c1cce2ad67 wayland: WIP 2020-04-15 00:00:40 +01:00
Ladislav Michl
4311a8191b wayland: Use memfd_create 2020-04-15 00:00:40 +01:00
Ladislav Michl
e805a4a6c0 wayland: Whitespace fixes 2020-04-15 00:00:40 +01:00
Ladislav Michl
05f362d528 wayland: Add wayland integration and use stable protocol.
non functional, all changes just make it compile again. Configure changes
by Ivan Vučica.
2020-04-15 00:00:40 +01:00
Sergio L. Pascual
81456203b2 Dirty Wayland backend implementation. 2020-04-15 00:00:40 +01:00
Sergii Stoian
05986c15da * Source/art/GNUmakefile.preamble,
* Source/gsc/GNUmakefile.preamble: do not overwrite ADDITIONAL_INCLUDE_DIRS
  value to help RPM build. In spec file ADDITIONAL_INCLUDE_DIRS can be sat
  to subdirectories which are create by RPM build tool.
2020-03-12 11:43:39 +02:00
Sergii Stoian
fc68da6be2 * Source/x11/XGServerWindow.m (placewindow::): check window frame
in OpenStep and Xlib coordinate systems to decide if it was changed.
  Rename `xVal` into more meaninful `xFrame` (holds temporary value of
  window frame in Xlib coordiante system).
2020-03-05 02:10:23 +02:00
Sergii Stoian
db1079b5e3 * Headers/x11/XGServer.h,
* Source/x11/XGServer.m (xScreenSize): new primitive method.

* Source/x11/XGDragView.m (XY): use new primitive method to get Xlib
  screen height. Fixes broken DnD on vertically aligned monitors.
2020-03-03 01:59:04 +02:00
Sergii Stoian
da144f3bdc * Source/x11/XGServerWindow.m (placewindow::): call XMoveResizeWindow
even if specified frame is equal current. No events will be send to
  -gui for this case but X11 window position will be refreshed. It fixes
  misplacement of image in slideImage:from:to: (second and all subsequent
  calls).
2020-03-01 02:17:32 +02:00
Sergii Stoian
2a0e305a4f * Headers/x11/XGServerWindow.h (_gswindow_device_t): new structure
memeber was added - `osframe`. This member intended to hold cached frame
  of windows in OpenStep coordinate system. This makes backend more
  reliable to the cases when gui changes NSWindow's _frame ivar before
  call to backend methods which make windows placement.

* Source/x11/XGServerWindow.m (placewindow::): use `osframe` structure
  member to decide if window change position or size. Removed usage of
  temporary `frame` (used only for making desicion).
2020-02-26 01:53:01 +02:00
Sergii Stoian
0e811399dc * Source/x11/XGServerEvent.m (mouseLocationOnScreen🪟): use xScreenSize
instead of DisplayHeight. Fixes mouse events handling on multi-monitor
  configuration with vertical layout.
2020-02-26 01:45:47 +02:00
Sergii Stoian
70e4222ece * Source/x11/XGServerWindow.m (placewindow::): move NSWindow fetching
code closer to its usage.
2020-02-24 23:53:57 +02:00
Sergii Stoian
f080ecdf78 Merge branch 'master' into randr
Conflicts:
	ChangeLog
2020-02-24 01:35:28 +02:00
Sergii Stoian
4c9ca90eac * Source/x11/XGServerWindow.m (placewindow::): use window->xframe
as current window frame instead of NSWindow's frame because
  `_frame` ivar may be already changed to target value.
2020-02-24 01:20:54 +02:00
fredkiefer
4924e11a0b * Source/x11/XGServerWindow.m (-_createAppIconPixmaps): Made
preconditions of new code explicit.
* Source/x11/XGServerWindow.m (-orderwindow:::): Set icon pixmap
only for WindowMaker.
2020-02-21 16:35:04 +01:00
Sergii Stoian
638940fb28 * Headers/x11/XGServer.h (GSDisplayServer): added new ivar xScreenSize
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.
2020-02-20 19:13:06 +02:00
fredkiefer
bf2b88f16e * Source/x11/XGServerWindow.m (screenList): Clean up implementation again. 2020-02-14 17:05:36 +01:00
Sergii Stoian
00a79638cf * Source/x11/XGServerWindow.m (screenList): revert back to old code
logic: if XRandR available but can't get screens info for some reasons,
  return array with one element (Xlib screen info).
2020-02-12 00:35:45 +02: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