mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-21 04:32:05 +00:00
Wayland: Respect top level bounds sent by compositor
This commit is contained in:
parent
c651312a88
commit
283eba9667
3 changed files with 11 additions and 0 deletions
8
glfw/internal.h
vendored
8
glfw/internal.h
vendored
|
|
@ -111,6 +111,13 @@ typedef void (* _GLFWdestroycontextfun)(_GLFWwindow*);
|
|||
#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82fc
|
||||
#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008
|
||||
|
||||
#define MAX(x, y) __extension__ ({ \
|
||||
__typeof__ (x) a = (x); __typeof__ (y) b = (y); \
|
||||
a > b ? a : b;})
|
||||
#define MIN(x, y) __extension__ ({ \
|
||||
__typeof__ (x) a = (x); __typeof__ (y) b = (y); \
|
||||
a < b ? a : b;})
|
||||
|
||||
typedef int GLint;
|
||||
typedef unsigned int GLuint;
|
||||
typedef unsigned int GLenum;
|
||||
|
|
@ -875,3 +882,4 @@ int _glfwPlatformSetWindowBlur(_GLFWwindow* handle, int value);
|
|||
char* _glfw_strdup(const char* source);
|
||||
|
||||
void _glfw_free_clipboard_data(_GLFWClipboardData *cd);
|
||||
|
||||
|
|
|
|||
2
glfw/wl_client_side_decorations.c
vendored
2
glfw/wl_client_side_decorations.c
vendored
|
|
@ -469,6 +469,8 @@ set_csd_window_geometry(_GLFWwindow *window, int32_t *width, int32_t *height) {
|
|||
if (!size_specified_by_compositor) {
|
||||
*width = window->wl.user_requested_content_size.width;
|
||||
*height = window->wl.user_requested_content_size.height;
|
||||
if (window->wl.xdg.top_level_bounds.width > 0) *width = MIN(*width, window->wl.xdg.top_level_bounds.width);
|
||||
if (window->wl.xdg.top_level_bounds.height > 0) *height = MIN(*height, window->wl.xdg.top_level_bounds.height);
|
||||
if (has_csd) *height += decs.metrics.visible_titlebar_height;
|
||||
}
|
||||
decs.geometry.x = 0; decs.geometry.y = 0;
|
||||
|
|
|
|||
1
glfw/wl_window.c
vendored
1
glfw/wl_window.c
vendored
|
|
@ -719,6 +719,7 @@ xdg_toplevel_configure_bounds(void *data, struct xdg_toplevel *xdg_toplevel UNUS
|
|||
_GLFWwindow *window = data;
|
||||
window->wl.xdg.top_level_bounds.width = width;
|
||||
window->wl.xdg.top_level_bounds.height = height;
|
||||
debug("Compositor set top-level bounds of: %dx%d\n", width, height);
|
||||
}
|
||||
|
||||
static const struct xdg_toplevel_listener xdgToplevelListener = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue