Implement <resize><drawContents>

<resize><drawContents>[yes|no] configures whether to let the clients
redraw its window content content while resizing.

When <resize><drawContents> is set to no, a multi-rect is shown to
indicate the geometry of the resized window.
This commit is contained in:
tokyo4j 2024-05-29 11:06:39 +09:00 committed by Johan Malm
parent 25415eb7ab
commit bb1d0b4352
10 changed files with 113 additions and 12 deletions

View file

@ -24,6 +24,7 @@
#include "menu/menu.h"
#include "regions.h"
#include "resistance.h"
#include "resize-outlines.h"
#include "ssd.h"
#include "view.h"
#include "xwayland.h"
@ -306,7 +307,11 @@ process_cursor_resize(struct server *server, uint32_t time)
server->grab_box.width - new_view_geo.width;
}
view_move_resize(view, new_view_geo);
if (rc.resize_draw_contents) {
view_move_resize(view, new_view_geo);
} else {
resize_outlines_update(view, new_view_geo);
}
}
void
@ -1134,6 +1139,9 @@ cursor_finish_button_release(struct seat *seat)
if (server->input_mode == LAB_INPUT_STATE_MOVE
|| server->input_mode == LAB_INPUT_STATE_RESIZE) {
if (resize_outlines_enabled(server->grabbed_view)) {
resize_outlines_finish(server->grabbed_view);
}
/* Exit interactive move/resize mode */
interactive_finish(server->grabbed_view);
return true;