improvement on xdg request handles

This commit is contained in:
DanyLE
2024-04-01 22:12:35 +02:00
parent 8945f8b345
commit 0d84bd388c
8 changed files with 83 additions and 46 deletions

View File

@@ -48,7 +48,6 @@ void diyac_reset_cursor_mode(struct diyac_server *server)
/* Reset the cursor mode to passthrough. */
server->seat.cursor_mode = DIYAC_CURSOR_PASSTHROUGH;
server->grabbed_view = NULL;
//struct diyac_view * view = diyac_view_at()
}
static void process_cursor_move(struct diyac_server *server, uint32_t time)
@@ -57,6 +56,9 @@ static void process_cursor_move(struct diyac_server *server, uint32_t time)
struct diyac_view *toplevel = server->grabbed_view;
if(toplevel->state != DIYAC_VIEW_NORMAL)
{
// cancel maximize or fullscreen state
wlr_xdg_toplevel_set_maximized(toplevel->xdg_toplevel, false);
wlr_xdg_toplevel_set_fullscreen(toplevel->xdg_toplevel, false);
// move the windows to cursor
server->grab_x = toplevel->original.width * server->grab_x / toplevel->output->usable_area.width;
}