mirror of
https://github.com/swaywm/sway.git
synced 2025-11-25 06:59:48 -05:00
Merge pull request #2820 from Emantor/fix-mouse-warping-container
Fix mouse warping container
This commit is contained in:
commit
765c80e5f7
8 changed files with 102 additions and 68 deletions
|
|
@ -406,26 +406,18 @@ static void handle_map(struct wl_listener *listener, void *data) {
|
|||
view->natural_height = view->wlr_xdg_surface->surface->current.height;
|
||||
}
|
||||
|
||||
view_map(view, view->wlr_xdg_surface->surface);
|
||||
bool csd = false;
|
||||
|
||||
if (!view->xdg_decoration) {
|
||||
struct sway_server_decoration *deco =
|
||||
decoration_from_surface(xdg_surface->surface);
|
||||
bool csd = !deco || deco->wlr_server_decoration->mode ==
|
||||
decoration_from_surface(xdg_surface->surface);
|
||||
csd = !deco || deco->wlr_server_decoration->mode ==
|
||||
WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT;
|
||||
view_update_csd_from_client(view, csd);
|
||||
|
||||
}
|
||||
|
||||
if (xdg_surface->toplevel->client_pending.fullscreen) {
|
||||
container_set_fullscreen(view->container, true);
|
||||
arrange_workspace(view->container->workspace);
|
||||
} else {
|
||||
if (view->container->parent) {
|
||||
arrange_container(view->container->parent);
|
||||
} else if (view->container->workspace) {
|
||||
arrange_workspace(view->container->workspace);
|
||||
}
|
||||
}
|
||||
view_map(view, view->wlr_xdg_surface->surface,
|
||||
xdg_surface->toplevel->client_pending.fullscreen, csd);
|
||||
|
||||
transaction_commit_dirty();
|
||||
|
||||
|
|
|
|||
|
|
@ -402,25 +402,14 @@ static void handle_map(struct wl_listener *listener, void *data) {
|
|||
view->natural_width = view->wlr_xdg_surface_v6->surface->current.width;
|
||||
view->natural_height = view->wlr_xdg_surface_v6->surface->current.height;
|
||||
}
|
||||
|
||||
view_map(view, view->wlr_xdg_surface_v6->surface);
|
||||
|
||||
struct sway_server_decoration *deco =
|
||||
decoration_from_surface(xdg_surface->surface);
|
||||
bool csd = !deco || deco->wlr_server_decoration->mode ==
|
||||
WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT;
|
||||
view_update_csd_from_client(view, csd);
|
||||
decoration_from_surface(xdg_surface->surface);
|
||||
bool csd = !deco || deco->wlr_server_decoration->mode
|
||||
== WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT;
|
||||
|
||||
view_map(view, view->wlr_xdg_surface_v6->surface,
|
||||
xdg_surface->toplevel->client_pending.fullscreen, csd);
|
||||
|
||||
if (xdg_surface->toplevel->client_pending.fullscreen) {
|
||||
container_set_fullscreen(view->container, true);
|
||||
arrange_workspace(view->container->workspace);
|
||||
} else {
|
||||
if (view->container->parent) {
|
||||
arrange_container(view->container->parent);
|
||||
} else if (view->container->workspace) {
|
||||
arrange_workspace(view->container->workspace);
|
||||
}
|
||||
}
|
||||
transaction_commit_dirty();
|
||||
|
||||
xdg_shell_v6_view->commit.notify = handle_commit;
|
||||
|
|
|
|||
|
|
@ -405,18 +405,8 @@ static void handle_map(struct wl_listener *listener, void *data) {
|
|||
xwayland_view->commit.notify = handle_commit;
|
||||
|
||||
// Put it back into the tree
|
||||
view_map(view, xsurface->surface);
|
||||
view_map(view, xsurface->surface, xsurface->fullscreen, false);
|
||||
|
||||
if (xsurface->fullscreen) {
|
||||
container_set_fullscreen(view->container, true);
|
||||
arrange_workspace(view->container->workspace);
|
||||
} else {
|
||||
if (view->container->parent) {
|
||||
arrange_container(view->container->parent);
|
||||
} else if (view->container->workspace) {
|
||||
arrange_workspace(view->container->workspace);
|
||||
}
|
||||
}
|
||||
transaction_commit_dirty();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue