Commit graph

35 commits

Author SHA1 Message Date
Sebastian Krzyszkowiak
15c44098d6 wayland: ask xdg-decoration protocol extension to use server-side decorations if possible. 2018-11-04 21:08:40 +01:00
Sebastian Krzyszkowiak
b204de6c4b wayland: fix resizing and fullscreen toggling
For starters, we need to correctly respond to 0,0 configure after unsetting
fullscreen. Also, turns out that there should be no drawing calls at all
in between eglSwapBuffers and wl_egl_window_resize, as otherwise EGL can
already allocate a wrongly sized buffer for a next frame, so handle those
together.
2018-11-07 01:08:35 +01:00
Ryan C. Gordon
9f99a9c642 Merge SDL-ryan-batching-renderer branch to default.
--HG--
extra : rebase_source : 83b86d35497a01be6f48055490580bbba19ccc7a
extra : amend_source : faae1a04859499ede43aba3ba50fc4f62b5afbcb
2018-10-31 15:03:41 -04:00
Ryan C. Gordon
25e38e5a3e wayland: ask KDE protocol extension to use server-side decorations if possible.
--HG--
branch : SDL-ryan-batching-renderer
2018-10-29 10:14:59 -04:00
Ryan C. Gordon
8ca5da741d wayland: Fixed missing window sizing events.
Fixes Bugzilla #4242.

--HG--
extra : rebase_source : a4acd992b5d392711e0d4e4b8b5d73c1e0b83145
2018-10-05 17:24:03 -04:00
Ryan C. Gordon
f881ef4e85 wayland: Implemented xdg-wm-base support.
This is just in parity with the existing zxdg-shell-unstable-v6 code. Making
the Wayland target robust (and uh, with title bars) is going to take a lot
of work on top of this.

--HG--
extra : amend_source : eb632de165fc406527a6627635382c22151223b5
2018-06-24 22:42:36 -07:00
Sam Lantinga
f65bdeb358 Fixed whitespace 2018-09-24 11:49:25 -07:00
Ryan C. Gordon
a004da5bd2 wayland: zxdg_shell_v6 needs a configure event before using a surface at all.
Fixes Bugzilla #4109.
Fixes Bugzilla #4119.

--HG--
extra : rebase_source : 865cc79d9d4f9c7a3c6548ad2645dbad801cd8c9
2018-04-15 17:42:09 -04:00
Ryan C. Gordon
c4d0b17522 wayland: Add support for xdg-shell protocol (unstable v6).
This is meant to be the desktop-enhanced version of wl_shell. Right now we
just match what the existing wl_shell code does, but there are other areas of
functionality available to us now, that we can fill in later.

This uses the "unstable" API, since this is what ships in Ubuntu 17.10 (as
part of Wayland 1.10), but Wayland 1.12 promotes this to stable with extremely
minor changes. We will add support for the stable version when it makes sense
to do so.

--HG--
extra : rebase_source : dbc84f58501611364f8ecabe5a004e26b4debbf1
2018-02-07 13:13:55 -05:00
Sam Lantinga
346af016a5 Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga
520aaf19a4 Fixed bug 3745 - specify SDLCALL as the calling convention for API callbacks
Patches contributed by Ozkan Sezer
2017-08-14 06:28:21 -07:00
Philipp Wiesemann
852d858c79 Fixed missing error messages for SDL_GetWindowWMInfo(). 2017-06-11 22:30:39 +02:00
Ryan C. Gordon
4239fb0f6d syswm: prevent buffer overflow if SDL and app have different config headers.
This only affects Wayland and DirectFB, as a Unix system generally has X11
support. Other platforms also have different sizes for the C union in
question, but are likely the only target for that platform, etc.

Apps that might run on Wayland or DirectFB will need to be compiled against
new headers from an official 2.0.6 release, or be prepared to force the x11
target, or not use SDL_GetWindowWMInfo().

Fixes Bugzilla #3428.

--HG--
extra : rebase_source : 281e37767b92a1a0b9ddbf3efb246d4932126412
2017-06-11 00:50:26 -04:00
Sam Lantinga
1b24bfad38 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Thomas Perl
1dd0c768de [qtwayland] Set orientation and window flags via SDL hints 2016-11-13 10:39:04 +01:00
Sam Lantinga
b07188e5ff Fixed bug 3063 - Wayland: SDL resizes EGL surface to 0x0.
x414e54

Wayland will sometimes send empty resize events (0 width and 0 height) to the client. I have not worked out the exact conditions a client would receive these but I can assume it might be if the window is offscreen or not mapped yet.

This causes issues with some SDL clients as they receive the 0x0 event and unexpected resize event or might not request to resize back to the correct size.

As per the wl_shell Wayland spec configure events are only a suggestion and the client is free to ignore or pick a different size (this is how min/max and fixed aspect ratio is supped to be implemented).

A patch is attached but is just the first iteration and I will fix any issues such as checking for FULLSCREEN/MAXIMIZED or RESIZABLE flags unless someone else fixes this first.

I have update to take into account non resizable and fullscreen windows. Also adding in maximize/restore and title functions for Wayland.
2016-10-07 18:11:03 -07:00
Sam Lantinga
aa51d46bdd wayland: Add support for relative mouse mode, by Jonas Ådahl <jadahl@gmail.com>
Generate the C protocol files from the protocol XML files installed by
wayland-protocols, and use them to implement support for relative pointer
motions and pointer locking.

Note that at the time, the protocol is unstable and may change in the future.
Any future breaking changes will, however, fail gracefully and result in no
regressions compared to before this patch.
2016-09-01 01:26:56 -07:00
Bastien Nocera
1d3cd63751 Wayland: Set "class" for each window we create
This will be used by Wayland compositors to match the application ID and
.desktop file to the SDL window(s).

Applications can set the SDL_VIDEO_WAYLAND_WMCLASS environemnt variable
early in the process to override using the binary name as a fallback.

Note that we also support the SDL_VIDEO_X11_WMCLASS in the Wayland
backend so that if a program correctly associated the desktop file with
the window under X11, only a newer SDL would be needed for it to work
under Wayland.

https://bugzilla.libsdl.org/show_bug.cgi?id=3376
2016-09-01 01:22:58 -07:00
Sam Lantinga
7ee8dda270 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Sam Lantinga
56b58afdbe Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Ryan C. Gordon
ce193a6e20 Implemented SetWindowHitTest() for Wayland (thanks, x414e54!).
Fixes Bugzilla #2941.

--HG--
extra : amend_source : 23d08e52de2c9db8636ad47043c4fcd334ed30a7
2015-04-12 20:40:06 -04:00
Philipp Wiesemann
844ac0dbed Wayland: Removed empty statement. 2015-04-10 23:44:55 +02:00
Philipp Wiesemann
fa7a33f5f3 Wayland: Fixed accessing not fully initialized window if no memory available.
The CreateWindow() implementation returned 0 on no more memory instead of -1.
2015-04-09 21:11:43 +02:00
Ryan C. Gordon
96c35e69fb Wayland: changed a few "SetError(); return -1;" to "return SetError()". 2015-04-07 22:49:56 -04:00
Emmanuel Gil Peyrot
8dba903d57 Wayland: Specify the output we want to put our window on.
Fixes Bugzilla #2803.

--HG--
extra : histedit_source : 34f21203939ff8993648acdbe02eb1b5cab0f2e2
2015-03-28 19:43:46 +01:00
Emmanuel Gil Peyrot
984599afad Wayland: Properly discover displays and their modes.
Fixes Bugzilla #2913.

--HG--
extra : histedit_source : afa4cb6d068d5612aa51fd2435c385e039ba081d
2015-03-18 01:14:45 +01:00
Arne Janbu
551c20baf2 Fix build on Linux when wayland is enabled
Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2838
2015-01-10 13:47:37 +01:00
Sam Lantinga
1c1bac24fd Fixed bug 2629 - Mac: crash when calling SDL_DestroyWindow with an active OpenGL context
Alex Szpakowski

Since this commit https://hg.libsdl.org/SDL/rev/1519c462cee6 , calling SDL_DestroyWindow will crash the program if the window has an active OpenGL context.

This is because the Cocoa_DestroyWindow code sets the window's driverdata to NULL and then calls [context setWindow:NULL], which tries to access the window's driverdata, resulting in a null pointer dereference.

I have attached a patch which fixes the issue by moving the line which sets the driverdata to NULL to after the lines which call functions that use the driverdata pointer.
2014-07-07 10:33:32 -07:00
Gabriel Jacobo
efffa3a0c4 Fixes #2512, handle configuration change messages sent by Wayland. Patch by Bryan Cain. 2014-05-10 16:50:05 -03:00
Thomas Perl
bfd5629d47 Wayland: Resize windows with 0x0 requested size to screen size
This makes it in line with other platforms, where SDL_CreateWindow() with
width=0, height=0 and SDL_WINDOW_FULLSCREEN opens a fullscreen window.
2014-04-05 17:19:34 +02:00
Sam Lantinga
d7940a513e Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
Ryan C. Gordon
831ef8c592 Patched to compile if Wayland is disabled via SDL_config.h (thanks, Martin!).
Fixes Bugzilla #2351.
2014-01-20 12:53:44 -05:00
Gabriel Jacobo
774a9eed75 Dynamic loading support for Wayland 2014-01-09 13:56:21 -03:00
Gabriel Jacobo
5f5b667aa3 Implements touch support on QTWayland. Contributed by Thomas Perl. 2013-12-27 09:29:39 -03:00
Gabriel Jacobo
3308d271b5 Wayland support
Based on the original port to Wayland by: Joel Teichroeb, Benjamin Franzke, Scott Moreau, et al.

Additional changes in this commit, done by me:

* Wayland uses the common EGL framework
* EGL can now create a desktop OpenGL context
* testgl2 loads GL functions dynamically, no need to link to libGL anymore
* Assorted fixes to the Wayland backend

Tested on the Weston Compositor (v1.0.5) that ships with Ubuntu 13.10,
running Weston under X. Tests ran: testrendercopyex (all backends), testgl2, testgles2,testintersections
2013-12-14 20:18:43 -03:00