102 Commits

Author SHA1 Message Date
Kovid Goyal
646bdbd002
Wayland: Fix a regression in the previous release that caused mouse cursor animation and keyboard repeat to stop working when switching seats
Fixes #5188
2022-06-10 21:38:30 +05:30
Kovid Goyal
65f1329635
Wayland: When the seat is closed remove any pending pointer animation and key repeat timers
Fixes #5145
2022-05-29 14:50:34 +05:30
Kovid Goyal
1b2d54d97a
Output a warning when libwayland-cursor returns incorrectly sized cursor images 2022-05-23 12:50:47 +05:30
Kovid Goyal
c48bf4fd85
Output debug lines for when kitty sets the pointer in Wayland 2022-04-30 09:13:08 +05:30
Kovid Goyal
1c3910de5c
Output debug info about resized being called 2022-03-10 19:32:17 +05:30
Alexander Orzechowski
d4b048735d wayland: Fix CSD size calculations
This is a partial revert of e359094cff68ec6cc26af407c2b924e5991eeec1

window->wl.{width, height} and window->wl.current.{width, height}
represent different things. The former represents the actual size of the
egl surface viewport used for terminal rendering. The former represents
the size of the entire window including the CSD (client side decorations).

These numbers should be the same if CSD is disabled.
2022-03-10 05:56:56 -05:00
Alexander Orzechowski
e359094cff wayland: move window state 2022-02-28 19:42:11 -05:00
Rui Ming (Max) Xiong
d2288d8f83 Scale touchpad input by display scale on wayland 2022-02-13 20:47:02 -05:00
Kovid Goyal
4b4f904aac
Dont use global variables for the axis discrete counts 2022-02-13 20:56:55 +05:30
Kovid Goyal
ee5cf90684
Cleanup previous PR and add changelog entry for it
Fixes #4694
2022-02-13 10:53:24 +05:30
Rui Ming (Max) Xiong
79fa9f1c95 Use counters for discrete flags instead 2022-02-12 17:45:28 -05:00
Rui Ming (Max) Xiong
40bf12af7a Check for discrete mouse events on wayland 2022-02-12 02:12:59 -05:00
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
91d82ebf4b
Remove unused import 2021-07-31 11:27:29 +05:30
Kovid Goyal
9a2b0b6995
Wayland CSD: Double clicking on titlebar should toggle window maximize 2021-04-19 08:58:29 +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
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
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
fc8e147e4a
Fix mouse handling when using client side decorations
The mouse co-ordinates used by glfw were all wrong.
2021-03-25 09:27:25 +05:30
Kovid Goyal
62997956a0
Start work on Wayland text input protocol support 2021-03-23 16:33:04 +05:30
Kovid Goyal
6d18223f17
Use an id for keyboard focus tracking as well 2021-01-29 11:22:39 +05:30
Kovid Goyal
0443e5ad7f
Wayland: Use window ids rather than pointers to track windows for key repeat
Might fix #3266
2021-01-29 08:43:00 +05:30
Kovid Goyal
cb5ac1fcf8
DRYer 2020-11-22 12:24:00 +05:30
Kovid Goyal
53797b9ead
Wayland: Fix key repeat being stopped by the release of an unrelated key
Fixes #2191
2020-11-22 12:14:52 +05:30
Luflosi
2832a73285
GLFW: Wayland: Assume 96 DPI if physical size is <= 0
From upstream: 0ef149c8f2.
2020-10-14 14:43:40 +02:00
Kovid Goyal
069f09c43c
Move wlc destructor to just before the functions are unloaded 2020-07-29 17:18:03 +05:30
Kovid Goyal
35f821f6a1
Ensure wl_cursor_theme_destroy is called before it is released
Fix #2884
2020-07-29 17:13:00 +05:30
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
Luflosi
785973bb5e
GLFW: Make joystick platform code init on demand
From upstream: 782e6b6cef.
2020-07-23 23:56:30 +02:00
Luflosi
78efefcea1
Revert "Linux: Fix slow startup on some systems caused by GLFW searching for joysticks. Since kitty does not use joysticks, disable joystick support."
This reverts commit ab960ea12d3e1e3489898b663f8d678ece8b2409.
2020-07-23 23:56:21 +02:00
Luflosi
1342767805
GLFW: Wayland: Fix scroll offsets being inverted
From upstream: f760b124ca.

This commit does not actually change any behaviour, it merely makes the code style of the two lines more similar to the new upstream code.
2020-07-18 19:32:03 +02:00
Luflosi
e17036a7a5
Remove trailing whitespace 2020-07-09 01:57:39 +02:00
Luflosi
f356f63994
wayland: save serial from all input sources
From upstream: 92b3fd02e5.
2020-06-01 21:29:14 +02:00
TheDaemoness
7c3c87abf6
Initial implementation of proper HiDPI cursor support on Wayland. 2020-06-01 20:33:53 +05:30
Kovid Goyal
aa9c3cd634
Report modifier key state when sending wheel events to the terminal program 2020-04-29 20:02:55 +05:30
Kovid Goyal
2458c3a7c6
Implement drag and drop of text/plain for Wayland as well 2020-03-19 13:28:21 +05:30
Kovid Goyal
e142083d53
Remove unused code
Strip out the GLFW timer code, since we use our own kitty based
monotonic clock.
2019-12-19 16:27:25 +05:30
Kovid Goyal
ae27d36902
Fix previous merge 2019-12-18 18:42:59 +05:30
Luflosi
778474f436
Wayland: Unset the cursor shape on border exit
From upstream: ef6189f348.
2019-12-18 14:01:29 +01:00
Luflosi
468468ab9f
Wayland: Don’t update cursor position in the frame
From upstream: a80788c17f.
2019-11-22 12:38:56 +01:00
Luflosi
aed7a197c7
Wayland: Don’t reload the cursor on every pointer motion
From upstream: a9f674e719.
2019-11-22 02:35:14 +01:00
Kovid Goyal
f476c56f91
Drop support for the gtk_primary_selection wayland protocol
sway recently decided to start complaining when binding
wp_primary_selection_device_manager interface to gtk_primary_selection
name, which means we either have to maintain an in-tree version
of the gtk_primary_selection protocol or drop support for sway.

Sway has not quite annoyed me enough yet for the latter.

See #1977
2019-10-09 07:37:03 +05:30
Kovid Goyal
4a8f9efe79
Wayland: Resume key repeat on focus gained if the previously repeated key is pressed 2019-09-30 18:47:43 +05:30
Kovid Goyal
19d36fbe69
Wayland: Fix key repeat not being stopped when focus leaves window. This is expected behavior on Wayland, apparently
Fixes #2014
2019-09-30 16:45:39 +05:30
Kovid Goyal
0d68b7078c
Check for float conversion issues on build
Useful to catch any errors left over from the migration of times from
double to int64_t
2019-09-27 19:47:25 +05:30
Luflosi
f3b9ff5f9f
Use datatype monotonic_t instead of double to keep track of time
The time is stored in a signed 64 bit integer with nanosecond accuracy. This eliminates the possibility of floating-point inaccuracies.
`monotonic_t` can currently hold values large enough to work correctly for more than 200 years into the future.
Using a typedef instead of directly using `int64_t` everywhere will also allow easily changing the datatype in the future should the need arise for more precise or bigger time values.
2019-09-25 17:43:11 +02:00
Luflosi
28bb123be8
Update the GLFW version number from 3.3 to 3.4
Closes https://github.com/kovidgoyal/kitty/issues/1884.
From a337c56848.
2019-08-02 11:00:16 -05:00
Kovid Goyal
cab949a939
Fix building with compilers that dont support __has_include 2019-07-29 09:44:05 +05:30