Commit Graph

4736 Commits

Author SHA1 Message Date
533b642c47 Merge remote-tracking branch 'clearcode/im-support' 2023-11-02 01:25:47 +00:00
91a806e6c8 [*] just werk pls 2023-11-02 01:13:27 +00:00
be33711ac0 [-] Remove OpenGL again 2023-11-02 01:13:27 +00:00
Scr3amer
297582cc09
Bugfix : handle localised default monitor names
If your OS is not in English you won't have "Generic PnP Monitor" so the test will succeed inspite of having a localised default monitor name.

I changed the test to look for the output port between parenthesis as this is how the monitor will look like when driver is installed AFAICT.
2023-09-26 08:48:57 -04:00
Scr3amer
31746105e8
Simplify goto flow 2023-09-04 02:10:50 -04:00
Scr3amer
8c515ce8ef
Add early return if OS doesn't support accurate monitor name fetching 2023-09-04 02:02:01 -04:00
Scr3amer
b792ee1325
Fix fullscreen issue
Fixed the fullscreen issue by reverting my splitting of the function.
I'll check later why this happened.
2023-09-04 01:49:12 -04:00
Scr3amer
71dfe1fc45
ISO C90 2023-09-03 02:11:00 -04:00
Scr3amer
72b19e3070
Refactor my code by reusing some facilities provided by GLFW 2023-09-03 02:03:22 -04:00
Scr3amer
52ec4b29db
Merge branch 'glfw:master' into Dynamic-accurate-monitor-name-fetching 2023-09-01 03:14:04 -04:00
Locria Cyber
0c181dcf74
Fix to Pass tests 2023-06-14 18:57:57 +00:00
Locria Cyber
337a4589a9
Add guard for linux joystick 2023-06-13 15:22:22 +00:00
Locria Cyber
1e9380584a
Match gamepad by USB vendor+product on Linux 2023-06-12 22:45:57 +00:00
Camilla Löwy
3eaf1255b2 Wayland: Cleanup
Update naming and declarations to current standard.
2023-06-01 20:12:56 +02:00
Camilla Löwy
6b48f2be97 Wayland: Merge function called once
This brings together the two halves of the cursor setting logic for the
fallback decorations.
2023-06-01 20:12:22 +02:00
Camilla Löwy
00a663dafd Wayland: Fix fallback decorations emitting errors
A GLFW_CURSOR_UNAVAILABLE error would be emitted each time the cursor
moved over the fallback decorations if the standard cursor shape
appropriate for that part was missing on the system.

These errors served no useful purpose and have been removed.
2023-06-01 20:12:13 +02:00
Daijiro Fukuda
7e6eae060f Win32: Support preedit candidate feature
You can use this feature when you need to manage the drawing of
the preedit candidates on the application side.
2023-04-10 11:05:26 +09:00
Daijiro Fukuda
933b79bfd2 Add change log entries 2023-04-10 11:03:18 +09:00
Daijiro Fukuda
99eb48025a Add credit
new

- Daijiro Fukuda
- Ryo Ichinose (from #658)
- Yasutaka Kumei (from #658)
- xfangfang

already in the list

- Takuro Ashie
- Yoshiki Shibukawa
2023-04-07 18:00:40 +09:00
Daijiro Fukuda
df1ffa6a0b Doc: Improve document about IME features 2023-04-07 17:50:26 +09:00
Yoshiki Shibukawa
69af4a3fb7 Apply shibukawa's document fix
This fix is from shibukawa's fix:
  https://github.com/glfw/glfw/pull/658
  d36a164423
2023-04-07 16:04:29 +09:00
Daijiro Fukuda
7592cd8692 tests: Add tests for IME features
Co-authored-by: Takuro Ashie <ashie@clear-code.com>
2023-04-07 16:04:29 +09:00
Takuro Ashie
f50fd796cd Wayland: Support text_input_unstable_v3 and text_input_unstable_v1
They are wayland protocols to support input methods:
https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/text-input/text-input-unstable-v3.xml
https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/text-input/text-input-unstable-v1.xml

text_input_unstable_v3 is widely supported by major desktop environment
on GNU/Linux such as GNOME or KDE.

text_input_unstable_v1 isn't so popular but Weston which is the
reference Wayland implementation supports only it and doesn't support
text_input_unstable_v3 so that we also implement it.
2023-04-07 16:04:29 +09:00
Daijiro Fukuda
017090f46c X11: Support IME
This commit re-organizes 6e7f93916b96c643ca7abe45d09f72d841ff15ed.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR #1972 : https://github.com/glfw/glfw/pull/1972

Co-authored-by: Takuro Ashie <ashie@clear-code.com>
2023-04-07 16:04:29 +09:00
Daijiro Fukuda
a3f7da4769 Apply shibukawa's fix of GLFW for X11
This fix is based on shibukawa's fix:
  https://github.com/glfw/glfw/pull/658

The differences is the following.

* Remove `X_HAVE_UTF8_STRING` branching since the current logic doesn't use it
* Replace `XNDestroyCallback` for `XNPreeditAttributes` in `XCreateIC`

Co-authored-by: Yoshiki Shibukawa <yoshiki@shibu.jp>
Co-authored-by: Takuro Ashie <ashie@clear-code.com>
2023-04-07 15:51:40 +09:00
Daijiro Fukuda
21f02568a1 macOS: Support IME
This commit re-organizes 31b12b7f79a5aa8bd8f8eb1488a050ab894ca289.

* Use dynamic load for TIS functions and stop using Carbon.
* Generalize platform-specific features to _GLFWplatform.
* Add caret-position info to preedit-callback.
* Handle UTF16 data correctly.
* Implement `firstRectForCharacterRange:actualRange:` to display preedit candidate window correctly.
* Suppress _glfwInputKey during preediting.
* Ensure preedit cleared after committed.
* Fix wrong length of markedRange.
* Improve IME status APIs.
* Refactor code shapes and variable names.

Co-authored-by: Takuro Ashie <ashie@clear-code.com>
Co-authored-by: xfangfang <2553041586@qq.com>
2023-04-07 15:51:40 +09:00
Daijiro Fukuda
004d348def Apply shibukawa's fix of GLFW for MacOS
This fix is based on shibukawa's fix:
  https://github.com/glfw/glfw/pull/658
  d36a164423

Co-authored-by: Yoshiki Shibukawa <yoshiki@shibu.jp>
Co-authored-by: Takuro Ashie <ashie@clear-code.com>
2023-04-07 15:51:40 +09:00
Daijiro Fukuda
6536792f9f Win32: Support IME
This commit re-organizes 9d9af132610829f295c34ceb81b17af8b567b76f.

* Use dynamic load for Imm32.
* Generalize platform-specific features to _GLFWplatform.
* Add caret-position info to preedit-callback.
* Add cursorWidth to preeditCursor and related APIs.
* Handle UTF16 data correctly.
* Handle GCS_RESULTSTR so that committed texts are processed correctly.
* Handle WM_IME_ENDCOMPOSITION to clear preedit.
* Handle WM_IME_SETCONTEXT.
    * https://learn.microsoft.com/en-us/windows/win32/intl/wm-ime-setcontext#remarks
* Refactor code shapes and variable names.

Co-authored-by: Takuro Ashie <ashie@clear-code.com>
2023-04-07 15:51:40 +09:00
Daijiro Fukuda
181f2832cc Apply shibukawa's fix of GLFW for Windows
This fix is based on shibukawa's fix:
  https://github.com/glfw/glfw/pull/658
  d36a164423

Some minor coding style changes are made, but not yet follow glfw's one,
and some comments doesn't follow recent changes. So further work is
needed.

Co-authored-by: Yoshiki Shibukawa <yoshiki@shibu.jp>
Co-authored-by: Takuro Ashie <ashie@clear-code.com>
2023-04-07 15:51:40 +09:00
Scr3amer
7e2f1e4c5e
Forgot to rename an reference to a function after I modified the function name 2023-04-06 19:36:53 -04:00
Scr3amer
741ad809b1
Fixed some indentations to be consistent with rest of file 2023-04-06 19:35:37 -04:00
Scr3amer
6f08e09191
Fixed naming according to coding convention
Made a function camelCase.
2023-04-06 19:31:46 -04:00
Scr3amer
8fe887fe00 ISO C90 2023-04-06 19:09:15 -04:00
Scr3amer
ffae283e41 ISO C90 again 2023-04-06 19:09:15 -04:00
Scr3amer
ec5fbcd07d Buildfix - Github.dev tricked me with autocomplete... 2023-04-06 19:09:15 -04:00
Scr3amer
c87d0ea52b ISO C90 - Mixed declaration and code 2023-04-06 19:09:15 -04:00
Scr3amer
648bf7a5fb ISO C90 - Mixed declaration and code. 2023-04-06 19:09:15 -04:00
Scr3amer
6404b1bba4 ISO C90 - Split variable initialisation and declaration 2023-04-06 19:09:15 -04:00
Scr3amer
f1ee946007 Rename variable to better reflect its purpose 2023-04-06 19:09:15 -04:00
Scr3amer
7cd353f3af Rename struct to follow GLFW terminology 2023-04-06 19:09:15 -04:00
Scr3amer
fbf21ad70c Implement the feature 2023-04-06 19:09:15 -04:00
Camilla Löwy
3fa2360720 Update changelog
Related to #2198
2023-03-31 16:18:46 +02:00
TheBrokenRail
0b94e1b29b Wayland: Fix detection of joysticks after init
Closes #2198
2023-03-31 16:18:46 +02:00
Camilla Löwy
f27daa34ad Fix glfwinfo output of Vulkan layer spec version 2023-03-31 16:18:46 +02:00
Camilla Löwy
6f2d7064be Make glfwinfo try Vulkan even if GL/GLES fails 2023-03-31 16:18:46 +02:00
Camilla Löwy
9cce2896ee Null: Add (fictional) scancodes
This replaces the previous scheme where scancodes were equal to keycodes
(an implausible and potentially misleading situation) with a set of
scancodes invented purely for the null platform.
2023-03-31 15:56:01 +02:00
Camilla Löwy
23ab972724 Fix unquoted CMake variable references
The previous version did not handle paths containing whitespace
correctly.

Related to #2256
2023-03-31 15:33:15 +02:00
Naveen Karuthedath
36987271f2
Merge branch 'glfw:master' into drag-window-dev 2023-03-28 22:00:05 +05:30
Camilla Löwy
fbdb53b9ca Wayland: Add initial support for libdecor
This is partly based on the implementation of libdecor support in
PR #1693 by @ christianrauch.

Where available, the libdecor library is loaded at init and becomes the
preferred method for window decorations.  On compositors that support
XDG decorations, libdecor in turn uses those.  If not, libdecor has
a plug-in archtecture and may load additional libraries to either use
compositor-specific decorations or draw its own.

If necessary, support for libdecor can be disabled with the
GLFW_WAYLAND_LIBDECOR init hint.  This is mostly in case some part of
the dynamic loading or duplication of header material added here turns
out to cause problems with future versions of libdecor-0.so.0.

Fixes #1639
Closes #1693
Related to #1725
2023-03-27 22:03:36 +02:00
Camilla Löwy
cd466cf9fd Wayland: Simplify decoration side detection
This commit simplifies the detection of which element of a fallback
decorated window the pointer has entered.  Instead of looping through
the list of windows, the user pointer of fallback decoration surfaces is
set to the GLFW window object.
2023-03-27 22:03:36 +02:00