Lines Matching refs:_glfw

169     struct wl_shm_pool* pool = wl_shm_create_pool(_glfw.wl.shm, fd, length);
203 edge->surface = wl_compositor_create_surface(_glfw.wl.compositor);
205 wl_proxy_set_tag((struct wl_proxy*) edge->surface, &_glfw.wl.tag);
206 edge->subsurface = wl_subcompositor_get_subsurface(_glfw.wl.subcompositor,
209 edge->viewport = wp_viewporter_get_viewport(_glfw.wl.viewporter,
214 struct wl_region* region = wl_compositor_create_region(_glfw.wl.compositor);
226 if (!_glfw.wl.viewporter)
305 region = wl_compositor_create_region(_glfw.wl.compositor);
393 if (wl_compositor_get_version(_glfw.wl.compositor) <
429 if (wl_proxy_get_tag((struct wl_proxy*) output) != &_glfw.wl.tag)
456 if (wl_proxy_get_tag((struct wl_proxy*) output) != &_glfw.wl.tag)
483 if (enable && !window->wl.idleInhibitor && _glfw.wl.idleInhibitManager)
487 _glfw.wl.idleInhibitManager, window->wl.surface);
803 while (!_glfw.wl.libdecor.ready)
806 window->wl.libdecor.frame = libdecor_decorate(_glfw.wl.libdecor.context,
867 wl_display_roundtrip(_glfw.wl.display);
917 window->wl.xdg.surface = xdg_wm_base_get_xdg_surface(_glfw.wl.wmBase,
956 if (_glfw.wl.decorationManager)
960 _glfw.wl.decorationManager, window->wl.xdg.toplevel);
983 wl_display_roundtrip(_glfw.wl.display);
989 if (_glfw.wl.libdecor.context)
1025 window->wl.surface = wl_compositor_create_surface(_glfw.wl.compositor);
1032 wl_proxy_set_tag((struct wl_proxy*) window->wl.surface, &_glfw.wl.tag);
1053 if (_glfw.wl.fractionalScaleManager)
1058 wp_viewporter_get_viewport(_glfw.wl.viewporter, window->wl.surface);
1066 _glfw.wl.fractionalScaleManager,
1085 struct wl_surface* surface = _glfw.wl.cursorSurface;
1105 timerfd_settime(_glfw.wl.cursorTimerfd, 0, &timer, NULL);
1113 wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.pointerEnterSerial,
1142 while (wl_display_flush(_glfw.wl.display) == -1)
1147 struct pollfd fd = { wl_display_get_fd(_glfw.wl.display), POLLOUT };
1161 if (scancode < sizeof(_glfw.wl.keycodes) / sizeof(_glfw.wl.keycodes[0]))
1162 return _glfw.wl.keycodes[scancode];
1169 if (sym == XKB_KEY_NoSymbol || !_glfw.wl.xkb.composeState)
1171 if (xkb_compose_state_feed(_glfw.wl.xkb.composeState, sym)
1174 switch (xkb_compose_state_get_status(_glfw.wl.xkb.composeState))
1177 return xkb_compose_state_get_one_sym(_glfw.wl.xkb.composeState);
1192 if (xkb_state_key_get_syms(_glfw.wl.xkb.state, keycode, &keysyms) == 1)
1198 const int mods = _glfw.wl.xkb.modifiers;
1208 if (_glfw.joysticksInitialized)
1216 [DISPLAY_FD] = { wl_display_get_fd(_glfw.wl.display), POLLIN },
1217 [KEYREPEAT_FD] = { _glfw.wl.keyRepeatTimerfd, POLLIN },
1218 [CURSOR_FD] = { _glfw.wl.cursorTimerfd, POLLIN },
1222 if (_glfw.wl.libdecor.context)
1223 fds[LIBDECOR_FD].fd = libdecor_get_fd(_glfw.wl.libdecor.context);
1227 while (wl_display_prepare_read(_glfw.wl.display) != 0)
1229 if (wl_display_dispatch_pending(_glfw.wl.display) > 0)
1237 wl_display_cancel_read(_glfw.wl.display);
1239 _GLFWwindow* window = _glfw.windowListHead;
1251 wl_display_cancel_read(_glfw.wl.display);
1257 wl_display_read_events(_glfw.wl.display);
1258 if (wl_display_dispatch_pending(_glfw.wl.display) > 0)
1262 wl_display_cancel_read(_glfw.wl.display);
1268 if (read(_glfw.wl.keyRepeatTimerfd, &repeats, sizeof(repeats)) == 8)
1272 _glfwInputKey(_glfw.wl.keyboardFocus,
1273 translateKey(_glfw.wl.keyRepeatScancode),
1274 _glfw.wl.keyRepeatScancode,
1276 _glfw.wl.xkb.modifiers);
1277 inputText(_glfw.wl.keyboardFocus, _glfw.wl.keyRepeatScancode);
1288 if (read(_glfw.wl.cursorTimerfd, &repeats, sizeof(repeats)) == 8)
1289 incrementCursorImage(_glfw.wl.pointerFocus);
1294 if (libdecor_dispatch(_glfw.wl.libdecor.context, 0) > 0)
1375 if (wl_proxy_get_tag((struct wl_proxy*) surface) != &_glfw.wl.tag)
1380 _glfw.wl.serial = serial;
1381 _glfw.wl.pointerEnterSerial = serial;
1382 _glfw.wl.pointerFocus = window;
1405 if (wl_proxy_get_tag((struct wl_proxy*) surface) != &_glfw.wl.tag)
1408 _GLFWwindow* window = _glfw.wl.pointerFocus;
1412 _glfw.wl.serial = serial;
1413 _glfw.wl.pointerFocus = NULL;
1414 _glfw.wl.cursorPreviousName = NULL;
1434 _GLFWwindow* window = _glfw.wl.pointerFocus;
1448 _glfw.wl.cursorPreviousName = NULL;
1489 if (_glfw.wl.cursorPreviousName != cursorName)
1491 struct wl_surface* surface = _glfw.wl.cursorSurface;
1492 struct wl_cursor_theme* theme = _glfw.wl.cursorTheme;
1495 if (window->wl.bufferScale > 1 && _glfw.wl.cursorThemeHiDPI)
1500 theme = _glfw.wl.cursorThemeHiDPI;
1516 wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.pointerEnterSerial,
1525 _glfw.wl.cursorPreviousName = cursorName;
1537 _GLFWwindow* window = _glfw.wl.pointerFocus;
1543 _glfw.wl.serial = serial;
1548 _glfw.wl.xkb.modifiers);
1563 xdg_toplevel_move(window->wl.xdg.toplevel, _glfw.wl.seat, serial);
1591 xdg_toplevel_resize(window->wl.xdg.toplevel, _glfw.wl.seat,
1600 _glfw.wl.seat, serial,
1614 _GLFWwindow* window = _glfw.wl.pointerFocus;
1660 keymap = xkb_keymap_new_from_string(_glfw.wl.xkb.context,
1693 xkb_compose_table_new_from_locale(_glfw.wl.xkb.context, locale,
1701 _glfw.wl.xkb.composeState = composeState;
1712 xkb_keymap_unref(_glfw.wl.xkb.keymap);
1713 xkb_state_unref(_glfw.wl.xkb.state);
1714 _glfw.wl.xkb.keymap = keymap;
1715 _glfw.wl.xkb.state = state;
1717 _glfw.wl.xkb.controlIndex = xkb_keymap_mod_get_index(_glfw.wl.xkb.keymap, "Control");
1718 _glfw.wl.xkb.altIndex = xkb_keymap_mod_get_index(_glfw.wl.xkb.keymap, "Mod1");
1719 _glfw.wl.xkb.shiftIndex = xkb_keymap_mod_get_index(_glfw.wl.xkb.keymap, "Shift");
1720 _glfw.wl.xkb.superIndex = xkb_keymap_mod_get_index(_glfw.wl.xkb.keymap, "Mod4");
1721 _glfw.wl.xkb.capsLockIndex = xkb_keymap_mod_get_index(_glfw.wl.xkb.keymap, "Lock");
1722 _glfw.wl.xkb.numLockIndex = xkb_keymap_mod_get_index(_glfw.wl.xkb.keymap, "Mod2");
1735 if (wl_proxy_get_tag((struct wl_proxy*) surface) != &_glfw.wl.tag)
1742 _glfw.wl.serial = serial;
1743 _glfw.wl.keyboardFocus = window;
1752 _GLFWwindow* window = _glfw.wl.keyboardFocus;
1758 timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
1760 _glfw.wl.serial = serial;
1761 _glfw.wl.keyboardFocus = NULL;
1772 _GLFWwindow* window = _glfw.wl.keyboardFocus;
1780 _glfw.wl.serial = serial;
1788 if (xkb_keymap_key_repeats(_glfw.wl.xkb.keymap, keycode) &&
1789 _glfw.wl.keyRepeatRate > 0)
1791 _glfw.wl.keyRepeatScancode = scancode;
1792 if (_glfw.wl.keyRepeatRate > 1)
1793 timer.it_interval.tv_nsec = 1000000000 / _glfw.wl.keyRepeatRate;
1797 timer.it_value.tv_sec = _glfw.wl.keyRepeatDelay / 1000;
1798 timer.it_value.tv_nsec = (_glfw.wl.keyRepeatDelay % 1000) * 1000000;
1802 timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
1804 _glfwInputKey(window, key, scancode, action, _glfw.wl.xkb.modifiers);
1818 _glfw.wl.serial = serial;
1820 if (!_glfw.wl.xkb.keymap)
1823 xkb_state_update_mask(_glfw.wl.xkb.state,
1831 _glfw.wl.xkb.modifiers = 0;
1839 { _glfw.wl.xkb.controlIndex, GLFW_MOD_CONTROL },
1840 { _glfw.wl.xkb.altIndex, GLFW_MOD_ALT },
1841 { _glfw.wl.xkb.shiftIndex, GLFW_MOD_SHIFT },
1842 { _glfw.wl.xkb.superIndex, GLFW_MOD_SUPER },
1843 { _glfw.wl.xkb.capsLockIndex, GLFW_MOD_CAPS_LOCK },
1844 { _glfw.wl.xkb.numLockIndex, GLFW_MOD_NUM_LOCK }
1849 if (xkb_state_mod_index_is_active(_glfw.wl.xkb.state,
1853 _glfw.wl.xkb.modifiers |= modifiers[i].bit;
1863 if (keyboard != _glfw.wl.keyboard)
1866 _glfw.wl.keyRepeatRate = rate;
1867 _glfw.wl.keyRepeatDelay = delay;
1884 if ((caps & WL_SEAT_CAPABILITY_POINTER) && !_glfw.wl.pointer)
1886 _glfw.wl.pointer = wl_seat_get_pointer(seat);
1887 wl_pointer_add_listener(_glfw.wl.pointer, &pointerListener, NULL);
1889 else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && _glfw.wl.pointer)
1891 wl_pointer_destroy(_glfw.wl.pointer);
1892 _glfw.wl.pointer = NULL;
1895 if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !_glfw.wl.keyboard)
1897 _glfw.wl.keyboard = wl_seat_get_keyboard(seat);
1898 wl_keyboard_add_listener(_glfw.wl.keyboard, &keyboardListener, NULL);
1900 else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && _glfw.wl.keyboard)
1902 wl_keyboard_destroy(_glfw.wl.keyboard);
1903 _glfw.wl.keyboard = NULL;
1923 for (unsigned int i = 0; i < _glfw.wl.offerCount; i++)
1925 if (_glfw.wl.offers[i].offer == offer)
1928 _glfw.wl.offers[i].text_plain_utf8 = GLFW_TRUE;
1930 _glfw.wl.offers[i].text_uri_list = GLFW_TRUE;
1947 _glfw_realloc(_glfw.wl.offers,
1948 sizeof(_GLFWofferWayland) * (_glfw.wl.offerCount + 1));
1955 _glfw.wl.offers = offers;
1956 _glfw.wl.offerCount++;
1958 _glfw.wl.offers[_glfw.wl.offerCount - 1] = (_GLFWofferWayland) { offer };
1970 if (_glfw.wl.dragOffer)
1972 wl_data_offer_destroy(_glfw.wl.dragOffer);
1973 _glfw.wl.dragOffer = NULL;
1974 _glfw.wl.dragFocus = NULL;
1979 for (i = 0; i < _glfw.wl.offerCount; i++)
1981 if (_glfw.wl.offers[i].offer == offer)
1985 if (i == _glfw.wl.offerCount)
1988 if (surface && wl_proxy_get_tag((struct wl_proxy*) surface) == &_glfw.wl.tag)
1993 if (_glfw.wl.offers[i].text_uri_list)
1995 _glfw.wl.dragOffer = offer;
1996 _glfw.wl.dragFocus = window;
1997 _glfw.wl.dragSerial = serial;
2004 if (!_glfw.wl.dragOffer)
2010 _glfw.wl.offers[i] = _glfw.wl.offers[_glfw.wl.offerCount - 1];
2011 _glfw.wl.offerCount--;
2017 if (_glfw.wl.dragOffer)
2019 wl_data_offer_destroy(_glfw.wl.dragOffer);
2020 _glfw.wl.dragOffer = NULL;
2021 _glfw.wl.dragFocus = NULL;
2036 if (!_glfw.wl.dragOffer)
2039 char* string = readDataOfferAsString(_glfw.wl.dragOffer, "text/uri-list");
2046 _glfwInputDrop(_glfw.wl.dragFocus, count, (const char**) paths);
2062 if (_glfw.wl.selectionOffer)
2064 wl_data_offer_destroy(_glfw.wl.selectionOffer);
2065 _glfw.wl.selectionOffer = NULL;
2068 for (unsigned int i = 0; i < _glfw.wl.offerCount; i++)
2070 if (_glfw.wl.offers[i].offer == offer)
2072 if (_glfw.wl.offers[i].text_plain_utf8)
2073 _glfw.wl.selectionOffer = offer;
2077 _glfw.wl.offers[i] = _glfw.wl.offers[_glfw.wl.offerCount - 1];
2078 _glfw.wl.offerCount--;
2103 xdg_activation_v1_activate(_glfw.wl.activationManager, token, window->wl.surface);
2182 if (window == _glfw.wl.pointerFocus)
2183 _glfw.wl.pointerFocus = NULL;
2185 if (window == _glfw.wl.keyboardFocus)
2186 _glfw.wl.keyboardFocus = NULL;
2455 if (!_glfw.wl.activationManager)
2463 xdg_activation_v1_get_activation_token(_glfw.wl.activationManager);
2473 if (!_glfw.wl.activationManager)
2480 xdg_activation_v1_get_activation_token(_glfw.wl.activationManager);
2486 _glfw.wl.serial,
2487 _glfw.wl.seat);
2489 _GLFWwindow* requester = _glfw.wl.keyboardFocus;
2532 return _glfw.wl.keyboardFocus == window;
2617 struct wl_region* region = wl_compositor_create_region(_glfw.wl.compositor);
2664 wl_display_sync(_glfw.wl.display);
2697 const int key = _glfw.wl.keycodes[scancode];
2703 xkb_state_key_get_layout(_glfw.wl.xkb.state, keycode);
2712 xkb_keymap_key_get_syms_by_level(_glfw.wl.xkb.keymap,
2732 const size_t count = _glfwEncodeUTF8(_glfw.wl.keynames[key], codepoint);
2740 _glfw.wl.keynames[key][count] = '\0';
2741 return _glfw.wl.keynames[key];
2746 return _glfw.wl.scancodes[key];
2803 cursor->wl.cursor = wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme, name);
2805 if (_glfw.wl.cursorThemeHiDPI)
2808 wl_cursor_theme_get_cursor(_glfw.wl.cursorThemeHiDPI, name);
2843 cursor->wl.cursor = wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme, name);
2852 if (_glfw.wl.cursorThemeHiDPI)
2857 wl_cursor_theme_get_cursor(_glfw.wl.cursorThemeHiDPI, name);
2928 if (!_glfw.wl.relativePointerManager)
2937 _glfw.wl.relativePointerManager,
2938 _glfw.wl.pointer);
2945 _glfw.wl.pointerConstraints,
2947 _glfw.wl.pointer,
2984 _glfw.wl.pointerConstraints,
2986 _glfw.wl.pointer,
3003 if (!_glfw.wl.pointer)
3045 wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme, "left_ptr");
3054 if (_glfw.wl.cursorThemeHiDPI)
3057 wl_cursor_theme_get_cursor(_glfw.wl.cursorThemeHiDPI, "left_ptr");
3076 wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.pointerEnterSerial, NULL, 0, 0);
3084 if (_glfw.wl.selectionSource != source)
3098 if (_glfw.wl.selectionSource != source ||
3105 char* string = _glfw.wl.clipboardString;
3134 if (_glfw.wl.selectionSource != source)
3137 _glfw.wl.selectionSource = NULL;
3149 if (_glfw.wl.selectionSource)
3151 wl_data_source_destroy(_glfw.wl.selectionSource);
3152 _glfw.wl.selectionSource = NULL;
3162 _glfw_free(_glfw.wl.clipboardString);
3163 _glfw.wl.clipboardString = copy;
3165 _glfw.wl.selectionSource =
3166 wl_data_device_manager_create_data_source(_glfw.wl.dataDeviceManager);
3167 if (!_glfw.wl.selectionSource)
3173 wl_data_source_add_listener(_glfw.wl.selectionSource,
3176 wl_data_source_offer(_glfw.wl.selectionSource, "text/plain;charset=utf-8");
3177 wl_data_device_set_selection(_glfw.wl.dataDevice,
3178 _glfw.wl.selectionSource,
3179 _glfw.wl.serial);
3184 if (!_glfw.wl.selectionOffer)
3191 if (_glfw.wl.selectionSource)
3192 return _glfw.wl.clipboardString;
3194 _glfw_free(_glfw.wl.clipboardString);
3195 _glfw.wl.clipboardString =
3196 readDataOfferAsString(_glfw.wl.selectionOffer, "text/plain;charset=utf-8");
3197 return _glfw.wl.clipboardString;
3202 if (_glfw.egl.EXT_platform_base && _glfw.egl.EXT_platform_wayland)
3210 return _glfw.wl.display;
3220 if (!_glfw.vk.KHR_surface || !_glfw.vk.KHR_wayland_surface)
3244 _glfw.wl.display);
3267 sci.display = _glfw.wl.display;
3290 if (_glfw.platform.platformID != GLFW_PLATFORM_WAYLAND)
3297 return _glfw.wl.display;
3304 if (_glfw.platform.platformID != GLFW_PLATFORM_WAYLAND)