1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-10-08 07:07:25 -04:00
Commit Graph

2352 Commits

Author SHA1 Message Date
Emmanuel Gil Peyrot 4e31dc5e6e Make it possible to toggle window decorations 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 1f8ec20b55 Correctly destroy subsurfaces on window destroy 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 4a42364a19 Return correct values for frame size 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 9f7ec6b094 Implement window decorations 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 9dc18a62a6 Rename wl_pointer to pointer 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 5b65b9b860 Prevent a crash when giving focus to a non-GLFWwindow surface 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 552e40a4be Add wl_subcompositor support 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 79e16baca3 Add wp_viewporter support 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 9a7656364e Split shm buffer creation out of _glfwPlatformCreateCursor 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot 2de3605b4c Make createAnonymousFile static 2018-02-25 16:54:44 +01:00
Emmanuel Gil Peyrot d6b9d00ceb Wayland: Handle monitor removal 2018-02-24 22:18:39 +01:00
Emmanuel Gil Peyrot f67b610dd4 Wayland: Handle repeats which missed a timer 2018-02-24 21:06:25 +01:00
Emmanuel Gil Peyrot 608f055c72 Wayland: Open the timerfd with cloexec 2018-02-24 21:06:25 +01:00
Emmanuel Gil Peyrot 84d10b32c3 Wayland: Ask xkbcommon whether to repeat a key 2018-02-24 21:06:25 +01:00
Emmanuel Gil Peyrot 8bc0c5c2c0 Wayland: dlsym() xkb_keymap_key_repeats 2018-02-24 21:06:25 +01:00
Emmanuel Gil Peyrot 97bf16e5b6 Wayland: Check for wayland protocol version
wl_keyboard version 4 is more recent than the libwayland available in
Ubuntu 14.04.
2018-02-24 21:06:25 +01:00
Emmanuel Gil Peyrot 90f5edc0b8 Wayland: Use a timerfd for key repeat 2018-02-24 21:06:25 +01:00
Emmanuel Gil Peyrot c14a35e21e Wayland: Obtain keyboard repeat_info
This had to bump the seat version, we now may get the seat name but we
don’t do anything with it.
2018-02-24 21:06:25 +01:00
Camilla Löwy f4cd470bcb Move to modern mappings database with modifiers 2018-02-13 18:57:56 +01:00
Camilla Löwy 3c9011030f Cleanup 2018-02-13 18:33:31 +01:00
Camilla Löwy 2040309d0c Add support for gamepad mapping input modifiers
This adds support for the + and - and ~ input modifiers for joystick
axes.  It also changes how joystick axes are translated to buttons to
more closely match SDL 2.0.7.

Output modifiers are still not supported but have not yet been seen in
the wild.
2018-02-13 18:30:07 +01:00
Camilla Löwy 58cc4b2c5c Move full screen cursor centering to shared code 2018-02-07 16:47:00 +01:00
Camilla Löwy d10463ac91 Win32: Fix extra resize event during mode switch
The switch to full screen is now done with a single call to
SetWindowPos.
2018-02-07 16:46:59 +01:00
Camilla Löwy cfb5cb8805 Add comment 2018-02-07 16:46:58 +01:00
Camilla Löwy 1d75b205cb Cleanup
Allow window creation despite video mode setting failure.

Video mode setting failure is ignored the rest of the time and the
desired video mode has never been a hard constraint anyway.
2018-02-07 16:46:58 +01:00
Ahmad Fatoum f940a97500 Linux: Add support for kernels < v2.6.39
Broke build for me on CentOS-6, which sports a 2.6.32 kernel:
http://www.cpantesters.org/cpan/report/d956d128-0339-11e8-b0d1-b6c4abd39192

CentOS-6 is supported till 2020-11-30.

Closes #1196.
2018-02-07 16:46:58 +01:00
Camilla Löwy c29e4455bb Move more context logic out of glfwCreateWindow 2018-02-06 13:10:41 +01:00
Camilla Löwy 9bfa499d94 Formatting 2018-02-06 13:10:41 +01:00
Camilla Löwy 53b193a161 Wayland: Fix uninitialized variable warning
Related to #1143.
Fixes #1197.
2018-02-06 13:10:41 +01:00
Emmanuel Gil Peyrot f5d3954568 Stop checking for resizing
Fixes #1197
2018-02-06 12:57:17 +01:00
Camilla Löwy ae53cd29ef Improve context function error descriptions
Fixes #1193.
2018-01-30 19:28:37 +01:00
Camilla Löwy a678665c49 Cleanup 2018-01-30 19:28:37 +01:00
Corentin Wallez 8a8eefa0d8 Fail Vulkan surface creation if window has context
OpenGL / OpenGL ES cannot share presentation on a window with Vulkan.
This adds an error to `glfwCreateWindowSurface` when it is called on a
window without the GLFW_CLIENT_API hint set to GLFW_NO_API.  This
prevents undefined bahevior and hard to debug crashes.

Fixes #1194.
Closes #1205.
2018-01-30 19:25:17 +01:00
Emmanuel Gil Peyrot 525ad7bfb8 Close the libwayland-cursor handle after destroying the cursor theme
Fixes a segfault on glfwTerminate().
2018-01-29 04:55:55 +01:00
Emmanuel Gil Peyrot eb7c9994bf Prevent auto-iconify from firing on window creation 2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot f2617a671f Add a roundtrip after creating the xdg-surface
The specification says we must not attach a buffer until we’ve received
a configure event.
2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot 4778d02c67 Ignore _glfwPlatformShowWindow when already visible 2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot f710db6504 Ignore configure events of 0×0px 2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot 0e759c9422 Don’t set min/max size on GLFW_DONT_CARE 2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot ae44a28125 Wayland: Add an alternate surface role using xdg-shell
This protocol matches desktops much better than the deprecated
wl_shell, fixing a bunch of race conditions, removing undefined
behaviour, adding missing features, and generally providing a much more
user-friendly experience.

Since most compositors don’t support it yet, the wl_shell_surface role
is kept as fallback for now.
2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot 14856e8b60 Wayland: Bind, listen and destroy xdg_wm_base 2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot 73567ae5be Wayland: Add xdg-shell to the platform 2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot 0d5f7a9eab Wayland: Add xdg-shell to the build system 2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot a199efae44 Wayland: Emit an error when wl_shell is absent or unusable 2018-01-29 03:59:47 +01:00
Emmanuel Gil Peyrot 440e7e36f3 Fix typography of error messages 2018-01-29 02:34:10 +01:00
Emmanuel Gil Peyrot 407a3e2860 Load libwayland-cursor at runtime 2018-01-29 02:34:10 +01:00
Emmanuel Gil Peyrot 5fbf4ddde8 Load libwayland-egl at runtime 2018-01-29 02:34:10 +01:00
Emmanuel Gil Peyrot 6e69f63ffa Use the _glfw_dlopen/dlsym/dlclose define 2018-01-29 02:26:12 +01:00
Emmanuel Gil Peyrot eb732457ea Prevent a race between surface destruction and focus
The Wayland protocol is asynchronous, by the time we destroy a surface,
the compositor may have sent a wl_keyboard::enter or wl_pointer::enter
events which now point to no surface, yet we receive it after.

To prevent this race, we can just ignore any enter event targetting a
NULL surface.

Fixes #1150.
2018-01-29 02:03:24 +01:00
Camilla Löwy 973bf29622 Remove use of non-standard function strdup
Related to #873.
2018-01-17 11:56:35 +01:00
Camilla Löwy bb3ab87a18 Remove unmaintained internal Doxygen docs
The useful bits have been transformed to function definition comments.
The style guide stub has been added to the regular docs build.
2018-01-17 11:25:32 +01:00
Emmanuel Gil Peyrot 6c421f131d Wayland: Implement scale callback
Closes #1181.
2018-01-09 22:39:35 +01:00
Emmanuel Gil Peyrot 93186e4999 Wayland: Fix glfwTerminate segfault on failed init
Closes #1172.
2018-01-09 22:13:28 +01:00
ocornut 20b12204af Win32: Fix GLFW_FOCUSED hint being ignored
The window was activated by _glfwPlatformShowWindow, causing the
GLFW_FOCUSED window hint to be ignored when set to false.

Fixes #1179.
Closes #1180.
2018-01-09 20:36:13 +01:00
Camilla Löwy ee9dffcd66 Add GLFW_HOVERED for polling cursor hover state
This window attribute corresponds to the cursor enter/leave callback.

Fixes #1166.
2018-01-09 18:02:52 +01:00
Camilla Löwy 370eac3c48 Add glfwSetWindowContentScaleCallback
Related to #677.
Related to #1115.
2018-01-09 18:00:22 +01:00
Camilla Löwy 1034b6e0db Move context management out of glfwCreateWindow
Related to #25.
2018-01-09 17:58:54 +01:00
przemekmirek 9f91bd6ea9 Win32: Fix HDEVNOTIFY handle leak
Closes #1170.
2018-01-05 08:12:51 +01:00
Emmanuel Gil Peyrot 10c18f8124 Use quotes consistently for wayland-protocols 2017-12-20 04:53:42 +01:00
Camilla Löwy 7c2c7858c6 Add monitor and joystick user pointers 2017-12-19 15:08:28 +01:00
Camilla Löwy 9da2285b14 Cocoa: Make frame autosave hint a string 2017-12-19 15:08:28 +01:00
Camilla Löwy 6158801aeb Change glfwInitHintString to glfwWindowHintString
Fixes #1139.
2017-12-19 15:08:27 +01:00
Emmanuel Gil Peyrot c3cba58a71 Remove trailing whitespace 2017-12-14 15:36:55 +01:00
Camilla Löwy ce4672d74b Make glfwSetGamma use powf instead of pow
Related to #1125.
2017-12-14 02:22:27 +01:00
Camilla Löwy 8dab9f6ab1 Wayland: Clarify assertion
Related to #1143.
2017-12-13 21:57:32 +01:00
Camilla Löwy 682f1cf203 Fix wrong element array for hat to axis 2017-12-06 18:01:34 +01:00
Camilla Löwy 0e8c4ea7ce Add lock key modifier bits input mode
This adds the GLFW_MOD_CAPS_LOCK and GLFW_MOD_NUM_LOCK modifier bits.
Set the GLFW_LOCK_KEY_MODS input mode to enable these for all callbacks
that receive modifier bits.

Fixes #946.
2017-12-06 18:01:34 +01:00
Camilla Löwy fd72eb917e Mir: Fix modifier bit translation 2017-12-06 18:01:33 +01:00
Camilla Löwy 638c4b604e Cleanup 2017-12-06 18:01:33 +01:00
Camilla Löwy c2858e9ed7 Verify gamepad mapping indices match hardware 2017-12-06 18:01:32 +01:00
Camilla Löwy 7c87948eaf Win32: Fix accidentally working bit tests
Good grief.
2017-11-28 19:59:59 +01:00
Camilla Löwy 30489c5aa1 X11: Expose zero monitor for functional headless
Fixes #1147.
2017-11-28 14:37:49 +01:00
Camilla Löwy 9e6c0c747b X11: Fix segfault when using NVidia EGL 2017-11-27 15:54:33 +01:00
Camilla Löwy 3169179de1 Fix string literal exceeding max length
Fixes #1145.
2017-11-23 20:54:44 +01:00
Camilla Löwy fe9c7a01c5 Update gamepad mappings and source URL
This matches the recent upstream update.
2017-11-23 19:35:45 +01:00
Emmanuel Gil Peyrot 65166858ff Wayland: Add support for the idle-inhibit protocol
Closes #955.
2017-11-20 22:27:37 +01:00
Emmanuel Gil Peyrot d18431338a Wayland: Disable the compose key on old xkbcommon 2017-11-20 18:24:30 +01:00
Emmanuel Gil Peyrot cc87d5ab10 Wayland: Assert that we only get a known axis 2017-11-20 18:06:29 +01:00
Stephen Gowen bb13275b72 Cocoa: Fix Xcode Warnings
Closes #1132.
2017-11-20 18:04:05 +01:00
Kovid Goyal 68809869f9
Fix spurious error from glfwInitHintString
Closes #1138
2017-11-20 21:16:59 +05:30
Camilla Löwy 1fe319d234 Cocoa: Filter out duplicate size events
Fixes #1085.
2017-11-16 11:56:06 +01:00
Camilla Löwy d630684654 Win32: Remove double resize of full screen window
Related to #1085.
2017-11-16 11:56:03 +01:00
Camilla Löwy 8b81a03a5a Cocoa: Remove double resize of full screen window
Related to #1085.
2017-11-16 11:37:00 +01:00
Camilla Löwy 11e47f08b1 Add glfwGetWindowOpacity and glfwSetWindowOpacity
This adds support for setting the opacity of the whole window, including
any decorations.

Fixes #1089.
2017-11-15 15:46:01 +01:00
Camilla Löwy bf7cc2ffac Fix missing inclusion guard needed for unity build
Fixes #1127.
2017-11-15 04:21:41 +01:00
Camilla Löwy fb4f633243 Fix y-axis sign for XInput thumb sticks
This breaks strict compatibility but does it to make XInput y-axes
consistent with every other API and OS.

Fixes #1083.
2017-11-14 19:50:59 +01:00
Camilla Löwy 49130ab8ec Rename framebuffer transparency hint
This is a breaking change of an unreleased API.
2017-11-14 17:21:36 +01:00
Camilla Löwy baed2dad56 Cleanup 2017-11-10 02:58:19 +01:00
Camilla Löwy 98990217bc Cleanup 2017-11-10 02:58:19 +01:00
Camilla Löwy 71018b4ab5 Fix termination on mapping parse error 2017-11-10 02:58:18 +01:00
Camilla Löwy 79e2433eb0 Fix termination on sync object creation failure 2017-11-10 02:58:18 +01:00
Camilla Löwy 7b877c4e24 Improve placement when forcing windowed mode
This is a temporary fix while waiting the for workarea query.

Related to #1106.
2017-11-10 02:58:18 +01:00
Camilla Löwy 31cbb20ba2 Deprecate window parameter of clipboard functions 2017-11-10 02:52:16 +01:00
Camilla Löwy 80d181f12d Win32: Fix maximization of undecorated windows
Fixes #899.
2017-10-31 15:47:01 +01:00
Emmanuel Gil Peyrot a7a70cf34d Wayland: Add dynamic loading of libxkbcommon 2017-10-30 12:01:17 +00:00
Camilla Löwy a1154247fa Fix default value of GLFW_CENTER_CURSOR
Regression introduced by 72ac5badb0.

Fixes #1105.
2017-10-29 15:53:19 +01:00
Camilla Löwy fcedb0be32 Fix windows not detaching on monitor disconnect
Regression introduced by 04f559e28d.

Related to #1106.
2017-10-26 18:52:43 +02:00
Camilla Löwy bf09dba95b Cleanup 2017-10-26 18:05:56 +02:00
Camilla Löwy 16bf872117 Add content scale queries
This adds glfwGetWindowContentScale and glfwGetMonitorContentScale for
querying the recommended drawing scale factor for DPI-aware rendering.

Parts of this patch are based on code by @ferreiradaselva.

Fixes #235.
Fixes #439.
Fixes #677.
Fixes #845.
Fixes #898.
2017-10-26 17:26:36 +02:00
Camilla Löwy 94ee10e655 Remove trailing else 2017-10-03 00:41:19 +02:00