mirror of
https://github.com/swaywm/sway.git
synced 2025-01-31 13:16:42 +00:00
Merge branch 'master' into sensitivity
This commit is contained in:
commit
539cf9f3e8
|
@ -706,9 +706,7 @@ static void handle_frame(struct wl_listener *listener, void *user_data) {
|
||||||
|
|
||||||
if (output->max_render_time != 0) {
|
if (output->max_render_time != 0) {
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
clockid_t presentation_clock
|
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||||
= wlr_backend_get_presentation_clock(server.backend);
|
|
||||||
clock_gettime(presentation_clock, &now);
|
|
||||||
|
|
||||||
const long NSEC_IN_SECONDS = 1000000000;
|
const long NSEC_IN_SECONDS = 1000000000;
|
||||||
struct timespec predicted_refresh = output->last_presentation;
|
struct timespec predicted_refresh = output->last_presentation;
|
||||||
|
|
|
@ -169,12 +169,19 @@ static void set_tiled(struct sway_view *view, bool tiled) {
|
||||||
if (xdg_shell_view_from_view(view) == NULL) {
|
if (xdg_shell_view_from_view(view) == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
enum wlr_edges edges = WLR_EDGE_NONE;
|
if (wl_resource_get_version(view->wlr_xdg_toplevel->resource) >=
|
||||||
if (tiled) {
|
XDG_TOPLEVEL_STATE_TILED_LEFT_SINCE_VERSION) {
|
||||||
edges = WLR_EDGE_LEFT | WLR_EDGE_RIGHT | WLR_EDGE_TOP |
|
enum wlr_edges edges = WLR_EDGE_NONE;
|
||||||
WLR_EDGE_BOTTOM;
|
if (tiled) {
|
||||||
|
edges = WLR_EDGE_LEFT | WLR_EDGE_RIGHT | WLR_EDGE_TOP |
|
||||||
|
WLR_EDGE_BOTTOM;
|
||||||
|
}
|
||||||
|
wlr_xdg_toplevel_set_tiled(view->wlr_xdg_toplevel, edges);
|
||||||
|
} else {
|
||||||
|
// The version is too low for the tiled state; configure as maximized instead
|
||||||
|
// to stop the client from drawing decorations outside of the toplevel geometry.
|
||||||
|
wlr_xdg_toplevel_set_maximized(view->wlr_xdg_toplevel, tiled);
|
||||||
}
|
}
|
||||||
wlr_xdg_toplevel_set_tiled(view->wlr_xdg_toplevel, edges);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_fullscreen(struct sway_view *view, bool fullscreen) {
|
static void set_fullscreen(struct sway_view *view, bool fullscreen) {
|
||||||
|
@ -294,8 +301,11 @@ static void handle_commit(struct wl_listener *listener, void *data) {
|
||||||
memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
|
memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
|
||||||
if (container_is_floating(view->container)) {
|
if (container_is_floating(view->container)) {
|
||||||
view_update_size(view);
|
view_update_size(view);
|
||||||
wlr_xdg_toplevel_set_size(view->wlr_xdg_toplevel, view->geometry.width,
|
// Only set the toplevel size the current container actually has a size.
|
||||||
view->geometry.height);
|
if (view->container->current.width) {
|
||||||
|
wlr_xdg_toplevel_set_size(view->wlr_xdg_toplevel, view->geometry.width,
|
||||||
|
view->geometry.height);
|
||||||
|
}
|
||||||
transaction_commit_dirty_client();
|
transaction_commit_dirty_client();
|
||||||
} else {
|
} else {
|
||||||
view_center_surface(view);
|
view_center_surface(view);
|
||||||
|
|
Loading…
Reference in a new issue