Skip to content

Commit e232f8e

Browse files
committed
window.c: Restore property notify for the tile mode property.
It got renamed, and notifies removed, in 5.4. The window-list applet uses this to adjust title indicators.
1 parent e78b833 commit e232f8e

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

src/core/window.c

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ static MetaWindow *meta_window_find_tile_match (MetaWindow *window,
171171
gboolean vertical);
172172
static void update_edge_constraints (MetaWindow *window);
173173

174+
static void notify_tile_mode (MetaWindow *window);
175+
174176
/* Idle handlers for the three queues (run with meta_later_add()). The
175177
* "data" parameter in each case will be a GINT_TO_POINTER of the
176178
* index into the queue arrays to use.
@@ -3027,6 +3029,7 @@ meta_window_maximize (MetaWindow *window,
30273029
window->maximized_vertically = FALSE;
30283030
window->tile_mode = META_TILE_NONE;
30293031
from_tiled = TRUE;
3032+
notify_tile_mode (window);
30303033
}
30313034

30323035
meta_window_maximize_internal (window,
@@ -3496,11 +3499,20 @@ update_edge_constraints (MetaWindow *window)
34963499
}
34973500
}
34983501

3502+
static void
3503+
notify_tile_mode (MetaWindow *window)
3504+
{
3505+
g_object_freeze_notify (G_OBJECT (window));
3506+
g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_TILE_MODE]);
3507+
g_object_thaw_notify (G_OBJECT (window));
3508+
}
3509+
34993510
void
35003511
meta_window_tile (MetaWindow *window,
35013512
MetaTileMode tile_mode)
35023513
{
35033514
MetaMaximizeFlags directions;
3515+
gboolean changed = FALSE;
35043516

35053517
/* Maximization constraints beat tiling constraints, so if the window
35063518
* is maximized, tiling won't have any effect unless we unmaximize it
@@ -3512,6 +3524,8 @@ meta_window_tile (MetaWindow *window,
35123524

35133525
window->maximized_horizontally = FALSE;
35143526
window->maximized_vertically = FALSE;
3527+
3528+
changed = tile_mode != window->tile_mode;
35153529
window->tile_mode = tile_mode;
35163530

35173531
/* Don't do anything if no tiling is requested */
@@ -3566,6 +3580,9 @@ meta_window_tile (MetaWindow *window,
35663580

35673581
if (window->frame)
35683582
meta_frame_queue_draw (window->frame);
3583+
3584+
if (changed)
3585+
notify_tile_mode (window);
35693586
}
35703587

35713588
MetaTileMode
@@ -3697,7 +3714,10 @@ meta_window_unmaximize (MetaWindow *window,
36973714
meta_window_get_buffer_rect (window, &old_buffer_rect);
36983715

36993716
if (unmaximize_vertically)
3700-
window->tile_mode = META_TILE_NONE;
3717+
{
3718+
window->tile_mode = META_TILE_NONE;
3719+
notify_tile_mode (window);
3720+
}
37013721

37023722
meta_topic (META_DEBUG_WINDOW_OPS,
37033723
"Unmaximizing %s%s\n",
@@ -6678,7 +6698,12 @@ update_move (MetaWindow *window,
66786698
* is enabled, as top edge tiling can be used in that case
66796699
*/
66806700
window->shaken_loose = !meta_prefs_get_edge_tiling ();
6681-
window->tile_mode = META_TILE_NONE;
6701+
6702+
if (window->tile_mode != META_TILE_NONE)
6703+
{
6704+
window->tile_mode = META_TILE_NONE;
6705+
notify_tile_mode (window);
6706+
}
66826707

66836708
/* move the unmaximized window to the cursor */
66846709
prop =
@@ -6718,7 +6743,12 @@ update_move (MetaWindow *window,
67186743
MetaRectangle work_area;
67196744
int monitor;
67206745

6721-
window->tile_mode = META_TILE_NONE;
6746+
if (window->tile_mode != META_TILE_NONE)
6747+
{
6748+
window->tile_mode = META_TILE_NONE;
6749+
notify_tile_mode (window);
6750+
}
6751+
67226752
wmonitor = window->monitor;
67236753
n_logical_monitors =
67246754
meta_monitor_manager_get_num_logical_monitors (monitor_manager);

0 commit comments

Comments
 (0)