Commit Graph

182 Commits

Author SHA1 Message Date
Kovid Goyal
6da5a8073c
Wayland: Apparently Java doesnt even set text/plain as a mimetype when copying text. Instead it uses UTF8_STRING and STRING.
So check for those as well. Am guessing whoever wrote this code in Java
just copied their old X11 shit without checking the specs. See #4183
2021-11-03 20:46:33 +05:30
Kovid Goyal
ebaac70b27
Fix #4183 (paste in wyland with mime type text/plain) 2021-11-03 07:00:06 +05:30
Kovid Goyal
be34af4555
Remove inline from .c files
It is ignored by compilers and hides unused static functions
2021-08-03 09:11:17 +05:30
Kovid Goyal
6bfb704f6f
When going from csd->no csd increase window height to compensate for titlebar.
Sway will send the next configure event (for example when focus changes)
with titlebar height added, so to avoid a sudden resize at that time,
bump the height by the titlebar.
2021-07-31 14:56:45 +05:30
Kovid Goyal
80cebdefcd
Better fix for CSD toggling on Wayland
Draw CSD if the compositor wants us to. See #3888
2021-07-31 14:15:38 +05:30
Kovid Goyal
c26665ec4d
Wayland: If the compositor turns off server side decorations after turning them on do not draw client side decorations
This matches the behavior of GNOME based clients and in any case sway
seems to get very confused if CSD is drawn.

Fixes #3888
2021-07-31 11:41:27 +05:30
Kovid Goyal
2e01c1f37e
Wayland: Inform compositor of new window geometry when setting window size 2021-07-25 12:26:09 +05:30
Kovid Goyal
62656b24eb
GNOME: Add a new option to control the color of the kitty window titlebar 2021-04-25 11:22:23 +05:30
Kovid Goyal
93dfe19c35
GNOME: Fix maximize state not being remembered when focus changes and window decorations are hidden
Apparently mutter needs window geometry set after the surface commit not
before, otherwise it doesnt "stick". When decorations are not hidden
there were other commits caused by the decorations, masking the issue.

Fixes #3507
2021-04-23 14:04:12 +05:30
Kovid Goyal
cb41683f47
... 2021-04-19 20:12:20 +05:30
Kovid Goyal
629a8ad055
Fix #3501 2021-04-19 19:58:02 +05:30
Kovid Goyal
253de1eeca
Move the CSD metrics initialization into the CSD module 2021-04-07 22:28:04 +05:30
Kovid Goyal
4e6d5d3f1e
Fix GNOME breaking when setting window geometry
The current version of GNOME has a regression that causes the compositor
to send incorrect geometry with the next configure event if the CSD
buffers are created after a call to set_window_geometry.

So call set_window_geometry last. And shake head sadly.
2021-04-07 22:14:09 +05:30
Kovid Goyal
82a5733ec5
_glfwPLatformSetWindowSize() should not be called when handling configure events as it does a bunch of work already done before 2021-04-07 19:55:15 +05:30
Kovid Goyal
4822fa989e
Wayland: wire up live resize notification 2021-04-07 18:29:28 +05:30
Kovid Goyal
fe0e1adb2a
DRYer 2021-04-07 15:26:30 +05:30
Kovid Goyal
850a8218db
Allow toggling xdg configure debug output at runtime 2021-04-07 15:24:58 +05:30
Kovid Goyal
bf3fc5fb92
Also implement programmatic window resizing 2021-04-07 15:13:22 +05:30
Kovid Goyal
a19d1fc140
Restore size after all types of docking not just maximize/unmaximize
We make use of the fact that wayland tells us when the window is being
resized to track actual user requested sizes as opposed to compositor
requested ones.
2021-04-07 15:08:44 +05:30
Kovid Goyal
593eb1d952
Focus state needs to be updated always 2021-04-07 14:28:11 +05:30
Kovid Goyal
5a1bd93518
Handle all known xdg top level states 2021-04-07 13:33:06 +05:30
Kovid Goyal
7e78f30739
Wayland: Fix un-maximizing a window not restoring its size to what it was before being maximized 2021-04-05 13:47:50 +05:30
Kovid Goyal
3e2b626107
Inform compositor of visible window geometry
The numbers dont make logical sense, but they do what is expected on
GNOME and since only GNOME is stupid enough to insist on CSD, that's
all we care about.
2021-04-05 09:10:47 +05:30
Kovid Goyal
ff420b6495
Render top CSD shadow 2021-04-04 22:49:07 +05:30
Kovid Goyal
71fddeb1f5
Start work on shadow based CSD 2021-04-04 17:13:50 +05:30
Kovid Goyal
a1669267b3
Fix hiding on window decorations not working with new CSD code 2021-04-01 12:32:48 +05:30
Kovid Goyal
5d496216e0
Implement rendering of titles in CSD 2021-04-01 10:23:04 +05:30
Kovid Goyal
53f2df115e
Hook up re-render of title bar when title changes 2021-03-29 12:15:47 +05:30
Kovid Goyal
0593158a86
Refactor CSD code to avoid un-needed rerenders and use a single shm pool for all CSD buffers 2021-03-29 12:15:47 +05:30
Kovid Goyal
c1f8372efc
Hide edges when not focused 2021-03-29 12:15:47 +05:30
Kovid Goyal
e7931b0121
Get rid of the no longer needed viewporter protocol 2021-03-29 12:15:47 +05:30
Kovid Goyal
aeb82e7fb0
Refactor the rendering of CSD on Wayland 2021-03-29 12:15:47 +05:30
Kovid Goyal
4edbe0ea4f
Remove unnecessary opacity marking for decoration buffers 2021-03-25 16:28:49 +05:30
Kovid Goyal
8a267894f3
Make createShmBuffer re-useable 2021-03-25 16:04:12 +05:30
Kovid Goyal
0510cd47f4
Rename buffer -> edge_buffer 2021-03-25 15:19:11 +05:30
Kovid Goyal
44df11c443
Move CSD metrics into the window object
Makes them potentially configurable
2021-03-25 12:52:09 +05:30
Kovid Goyal
63a50ec066
Use the correct mouse cursor theme on GNOME
Relies on a working desktop settings portal (xdg-desktop-portal-gtk)
2021-03-25 12:20:13 +05:30
Kovid Goyal
317ecbc9fa
Wayland: Add support for the text input protocol
Fixes #3410
2021-03-24 11:24:37 +05:30
Kovid Goyal
34d06fa3e9
Use a struct for IME update events
Allows for easier extension in the future
2021-03-23 16:05:22 +05:30
Kovid Goyal
a981b46ec9
Use an enum for updateimestate as well 2021-03-23 10:52:11 +05:30
Kovid Goyal
12d7c7314a
Only warn about Wayland's inadequacy once 2021-02-26 19:21:48 +05:30
Kovid Goyal
6d18223f17
Use an id for keyboard focus tracking as well 2021-01-29 11:22:39 +05:30
Kovid Goyal
397d7d044b
Change key data type in some functions 2021-01-16 20:52:11 +05:30
Leonard König
bc2dcdf9db wl: Fix destroying CSDs in correct order (#3051)
On Wayland, some compositors refuse to implement SSDs in which case we draw
primitive CSDs.  However, the destructors were called in the wrong order,
leading to a dereference of an already freed object.
2020-10-28 18:57:37 +01:00
Luflosi
3df80545bd
Reduce the difference of GLFW to upstream 2020-10-26 11:02:55 +01:00
Kovid Goyal
6f40b8d0a1
Simplify Wayland cursor theme handling
Now themes are loaded once per scale and stored centrally not per
window. They are not unloaded till application shutdown. Since there
is unlikely to be more than two or three scales this is not a big waste
of resources. Since cursor lifetime is tied to theme lifetime and cursors
are stored per window, destroying a theme requires destroying all
cursors win all windows referring to that theme, which is too much work.

Should hopefully fix #2810
2020-07-25 15:36:46 +05:30
Kovid Goyal
dc4762a69a
Dont crash if Wayland returns a cursor image array with some null images 2020-07-21 19:33:05 +05:30
Luflosi
b1c3999a81
GLFW: Wayland: Fix partial framebuffer size retrieval
From upstream: 5f60c22cfa.
2020-07-17 21:10:32 +02:00
Luflosi
805921d6a3
GLFW: Move management of shared state to shared code
From upstream: 6d2003d07a.
2020-07-16 23:54:16 +02:00
Luflosi
d0c6ce9fd7
GLFW: Add support for mouse input transparency
From upstream: d285a9fdeb.
2020-07-16 22:25:12 +02:00