Skip to content

Commit 87572f7

Browse files
committed
tiling: Skip the resize effect for tiled windows during user grabs.
meta_window_tile gets called by the grabbed window's match(es) during tile resizing. These incremental changes don't need to be animated. upstream: https://gitlab.gnome.org/GNOME/mutter/-/commit/559e6ff327a358a6daa4b0683fee95700591749f This reverts and replaces commit a8068f3.
1 parent 1a941ec commit 87572f7

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

src/core/keybindings.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3672,7 +3672,7 @@ handle_tile_action (MetaDisplay *display,
36723672
{
36733673
window->tile_monitor_number = window->monitor->number;
36743674
window->tile_mode = META_TILE_NONE;
3675-
meta_window_tile (window, new_mode, FALSE);
3675+
meta_window_tile (window, new_mode);
36763676
}
36773677
}
36783678

src/core/window-private.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,7 @@ void meta_window_queue (MetaWindow *window,
686686
guint queuebits);
687687
META_EXPORT_TEST
688688
void meta_window_tile (MetaWindow *window,
689-
MetaTileMode mode,
690-
gboolean in_update_resize);
689+
MetaTileMode mode);
691690
MetaTileMode meta_window_get_tile_mode (MetaWindow *window);
692691
void meta_window_restore_tile (MetaWindow *window,
693692
MetaTileMode mode,

src/core/window.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3287,8 +3287,7 @@ meta_window_get_tile_fractions (MetaWindow *window,
32873287
static void
32883288
meta_window_update_tile_fractions (MetaWindow *window,
32893289
int new_w,
3290-
int new_h,
3291-
gboolean in_update_resize)
3290+
int new_h)
32923291
{
32933292
MetaWindow *vtile_match = window->vtile_match;
32943293
MetaWindow *htile_match = window->htile_match;
@@ -3304,10 +3303,10 @@ meta_window_update_tile_fractions (MetaWindow *window,
33043303
window->tile_vfraction = (double)new_h / work_area.height;
33053304

33063305
if (htile_match && window->display->grab_window == window)
3307-
meta_window_tile (htile_match, htile_match->tile_mode, in_update_resize);
3306+
meta_window_tile (htile_match, htile_match->tile_mode);
33083307

33093308
if (vtile_match && window->display->grab_window == window)
3310-
meta_window_tile (vtile_match, vtile_match->tile_mode, in_update_resize);
3309+
meta_window_tile (vtile_match, vtile_match->tile_mode);
33113310
}
33123311

33133312
static void
@@ -3457,10 +3456,10 @@ update_edge_constraints (MetaWindow *window)
34573456

34583457
void
34593458
meta_window_tile (MetaWindow *window,
3460-
MetaTileMode tile_mode,
3461-
gboolean in_update_resize)
3459+
MetaTileMode tile_mode)
34623460
{
34633461
MetaMaximizeFlags directions;
3462+
34643463
/* Maximization constraints beat tiling constraints, so if the window
34653464
* is maximized, tiling won't have any effect unless we unmaximize it
34663465
* horizontally first; rather than calling meta_window_unmaximize(),
@@ -3506,12 +3505,14 @@ meta_window_tile (MetaWindow *window,
35063505
/* Setup the edge constraints */
35073506
update_edge_constraints (window);
35083507

3509-
if (!in_update_resize)
3508+
if ((!window->htile_match || window->htile_match != window->display->grab_window) &&
3509+
(!window->vtile_match || window->vtile_match != window->display->grab_window))
35103510
{
35113511
MetaRectangle old_frame_rect, old_buffer_rect;
35123512

35133513
meta_window_get_frame_rect (window, &old_frame_rect);
35143514
meta_window_get_buffer_rect (window, &old_buffer_rect);
3515+
35153516
meta_compositor_size_change_window (window->display->compositor, window,
35163517
META_SIZE_CHANGE_TILE,
35173518
&old_frame_rect, &old_buffer_rect);
@@ -3540,8 +3541,8 @@ meta_window_restore_tile (MetaWindow *window,
35403541
int width,
35413542
int height)
35423543
{
3543-
meta_window_update_tile_fractions (window, width, height, FALSE);
3544-
meta_window_tile (window, mode, FALSE);
3544+
meta_window_update_tile_fractions (window, width, height);
3545+
meta_window_tile (window, mode);
35453546
}
35463547

35473548
static gboolean
@@ -4727,7 +4728,7 @@ meta_window_resize_frame_with_gravity (MetaWindow *window,
47274728
*/
47284729
if (window->display->grab_window == window)
47294730
adjust_size_for_tile_match (window, &w, &h);
4730-
meta_window_update_tile_fractions (window, w, h, TRUE);
4731+
meta_window_update_tile_fractions (window, w, h);
47314732
}
47324733

47334734
flags = (user_op ? META_MOVE_RESIZE_USER_ACTION : 0) | META_MOVE_RESIZE_RESIZE_ACTION;
@@ -6899,7 +6900,7 @@ end_grab_op (MetaWindow *window,
68996900
if (meta_grab_op_is_moving (window->display->grab_op))
69006901
{
69016902
if (window->display->preview_tile_mode != META_TILE_NONE)
6902-
meta_window_tile (window, window->display->preview_tile_mode, FALSE);
6903+
meta_window_tile (window, window->display->preview_tile_mode);
69036904
else
69046905
update_move (window,
69056906
modifiers & CLUTTER_SHIFT_MASK,

src/tests/monitor-unit-tests.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6113,7 +6113,7 @@ meta_test_monitor_wm_tiling (void)
61136113
g_error ("Failed to find the window: %s", error->message);
61146114
test_client_wait_for_window_shown (test_client, test_window);
61156115

6116-
meta_window_tile (test_window, META_TILE_MAXIMIZED, FALSE);
6116+
meta_window_tile (test_window, META_TILE_MAXIMIZED);
61176117
meta_window_move_to_monitor (test_window, 1);
61186118
check_test_client_state (test_client);
61196119

@@ -6144,14 +6144,14 @@ meta_test_monitor_wm_tiling (void)
61446144
emulate_hotplug (test_setup);
61456145

61466146
meta_window_move_to_monitor (test_window, 1);
6147-
meta_window_tile (test_window, META_TILE_NONE, FALSE);
6147+
meta_window_tile (test_window, META_TILE_NONE);
61486148

61496149
test_case.setup.n_outputs = 1;
61506150
test_setup = create_monitor_test_setup (&test_case,
61516151
MONITOR_TEST_FLAG_NO_STORED);
61526152
emulate_hotplug (test_setup);
61536153

6154-
meta_window_tile (test_window, META_TILE_MAXIMIZED, FALSE);
6154+
meta_window_tile (test_window, META_TILE_MAXIMIZED);
61556155

61566156
test_client_destroy (test_client);
61576157
}

0 commit comments

Comments
 (0)