Commit Graph

18 Commits

Author SHA1 Message Date
Vaxry 538a7a190d types/text-input-v3: assert on invalid _leave() and _enter() calls
It's invalid usage, but shouldn't cause memory mayhem, assert instead
2024-03-22 21:34:48 +00:00
Simon Ser 842093bb84 Define _POSIX_C_SOURCE globally
Stop trying to maintain a per-file _POSIX_C_SOURCE. Instead,
require POSIX.1-2008 globally. A lot of core source files depend
on that already.

Some care must be taken on a few select files where we need a bit
more than POSIX. Some files need XSI extensions (_XOPEN_SOURCE) and
some files need BSD extensions (_DEFAULT_SOURCE). In both cases,
these feature test macros imply _POSIX_C_SOURCE. Make sure to not
define both these macros and _POSIX_C_SOURCE explicitly to avoid
POSIX requirement conflicts (e.g. _POSIX_C_SOURCE says POSIX.1-2001
but _XOPEN_SOURCE says POSIX.1-2008).

Additionally, there is one special case in render/vulkan/vulkan.c.
That file needs major()/minor(), and these are system-specific.
On FreeBSD, _POSIX_C_SOURCE hides system-specific symbols so we need
to make sure it's not defined for this file. On Linux, we can
explicitly include <sys/sysmacros.h> and ensure that apart from
symbols defined there the file only uses POSIX toys.
2024-02-15 15:41:12 +01:00
Kirill Primak 0de3659698 Drop wl_client and user data assertions in bind handlers
A client can never be NULL and user data assertions aren't really
useful there.
2023-10-10 20:10:00 +03:00
Alexander Orzechowski 1b0694b794 treewide: Migrate from sizeof(struct) to sizeof(*pointer) where practical 2023-10-03 01:51:07 -04:00
Kirill Primak a09d649439 docs: replace the less commonly used "::" with "." 2023-10-02 22:10:16 +03:00
Väinö Mäkelä 0601813ab6 text-input: Handle inert seats 2023-06-03 10:43:12 +00:00
Alexander Orzechowski ef4baea0e2 Use wl_signal_emit_mutable 2022-08-18 07:16:16 -04:00
Kirill Primak 617eb4fb93 surface: deprecate wlr_surface.h 2022-01-13 10:06:41 +00:00
Isaac Freund ab16861e86 text-input: fix type of send_preedit_string() args
The protocol uses a signed integer here, which is also what the
wlr_input_method_v2_preedit_string struct provides to compositors from
the input method protocol. Sway currently just passes those int32_t
values directly to this function leading to an implicit conversion.
2021-11-08 19:56:22 +00:00
Isaac Freund e326b76959
text-input/input-method: handle strdup() failure 2021-11-07 21:01:24 +01:00
Tadeo Kondrak 78685ec6aa text_input_v3: correct typo in enum field 2021-02-15 16:33:05 +01:00
Dorota Czaplejewicz 37adcac5d1 text_input_v3: Note features supported by the text field
With this information, consumers can realize they will never retrieve some state, and adjust their strategy.
2020-02-20 16:21:44 +01:00
xdavidwu 3b35043d00 text-input: fix missing destroy signal init 2020-01-12 12:12:26 +01:00
Simon Ser 5cde35923c Simplify globals implementation by removing destructors
Some globals are static and it doesn't make sense to destroy them before
the wl_display. For instance, wl_compositor should be created before the
display is started and shouldn't be destroyed.

For these globals, we can simplify the code by removing the destructor
and stop keeping track of wl_resources (these will be destroyed with the
wl_display by libwayland).
2019-11-25 09:01:46 -05:00
emersion 27d1910bec
text-input-v3: remove newline in log message 2018-11-26 12:15:34 +01:00
Dorota Czaplejewicz 14c6ee894e text-input: Don't reject enable requests when unfocused
The prevoius implementation would always raise an error in the following sequence:

-> enter
-> leave
<- enable

The text-input type is not equipped to manage the validity of clents' requests, which should be handled in the compositor, as rootston does.
2018-10-17 15:34:41 +00:00
Dorota Czaplejewicz 226eedfa2b text-input: fix releasing destroy handlers 2018-10-12 20:09:11 +00:00
Dorota Czaplejewicz 427735fcd9 wlroots: add support for zwp_text_input_unstable_v3 2018-10-09 09:56:11 +00:00