diff options
author | Balazs Endresz <[email protected]> | 2023-01-07 19:57:28 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2023-01-14 16:50:43 +0100 |
commit | 5240fdc4a7efba5da151ac257e8b327d494a8845 (patch) | |
tree | 41c728101b3dfe5943c8e64cd43334da4c13de09 | |
parent | c7643edf77c5871b14e2196f347385a0d1557e04 (diff) | |
download | mate-panel-5240fdc4a7efba5da151ac257e8b327d494a8845.tar.bz2 mate-panel-5240fdc4a7efba5da151ac257e8b327d494a8845.tar.xz |
wncklet: fix incorrect preview positions for multiple monitors
-rw-r--r-- | applets/wncklet/window-list.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/applets/wncklet/window-list.c b/applets/wncklet/window-list.c index 7dd59c8a..2f58be96 100644 --- a/applets/wncklet/window-list.c +++ b/applets/wncklet/window-list.c @@ -333,7 +333,6 @@ static int find_offset(GList *list, int target) } #define PREVIEW_PADDING 5 -#define CONSTRAIN(x, min, max) x < min ? min : (x > max ? max : x) static void preview_window_reposition (WnckTasklist *tl, TasklistData *tasklist, @@ -428,6 +427,7 @@ preview_window_reposition (WnckTasklist *tl, y_pos = y_offset + find_offset (alloc_y_list, y_pos - y_offset) + (last_alloc.height - height) / 2; else y_pos -= height / 2; + y_pos = y_pos < PREVIEW_PADDING ? PREVIEW_PADDING : y_pos; } else if (orient == MATE_PANEL_APPLET_ORIENT_UP || orient == MATE_PANEL_APPLET_ORIENT_DOWN) { @@ -436,15 +436,12 @@ preview_window_reposition (WnckTasklist *tl, x_pos = x_offset + find_offset (alloc_x_list, x_pos - x_offset) + (last_alloc.width - width) / 2; else x_pos -= width / 2; + x_pos = x_pos < PREVIEW_PADDING ? PREVIEW_PADDING : x_pos; } g_list_free (alloc_x_list); g_list_free (alloc_y_list); - /* Don't let the preview window go off screen */ - x_pos = CONSTRAIN (x_pos, monitor_geom.x + PREVIEW_PADDING, monitor_geom.width - width - PREVIEW_PADDING); - y_pos = CONSTRAIN (y_pos, monitor_geom.y + PREVIEW_PADDING, monitor_geom.height - height - PREVIEW_PADDING); - gtk_window_move (GTK_WINDOW (tasklist->preview), x_pos, y_pos); } |