xfce4-panel/02_pager-size-for-viewport.patch
2021-06-16 10:53:42 +08:00

24 lines
1.2 KiB
Diff

diff -uNr xfce4-panel-4.16.0.orig/plugins/pager/pager.c xfce4-panel-4.16.0/plugins/pager/pager.c
--- xfce4-panel-4.16.0.orig/plugins/pager/pager.c 2020-12-11 07:14:07.000000000 +0800
+++ xfce4-panel-4.16.0/plugins/pager/pager.c 2021-06-16 10:48:07.941357680 +0800
@@ -776,6 +776,19 @@
else if (plugin->miniature_view)
{
n_workspaces = wnck_screen_get_workspace_count (plugin->wnck_screen);
+ if (n_workspaces == 1)
+ {
+ WnckWorkspace *active_ws;
+ /* check if we ware in viewport mode */
+ active_ws = wnck_screen_get_active_workspace (plugin->wnck_screen);
+ if (wnck_workspace_is_virtual (active_ws))
+ {
+ /* number of rows * number of columns */
+ n_workspaces = (wnck_workspace_get_width (active_ws) / wnck_screen_get_width (plugin->wnck_screen))
+ * (wnck_workspace_get_height (active_ws) / wnck_screen_get_height (plugin->wnck_screen));
+ }
+ }
+
n_cols = MAX (1, (n_workspaces + plugin->rows - 1) / plugin->rows);
min_width = nat_width = (gint) (xfce_panel_plugin_get_size (XFCE_PANEL_PLUGIN (plugin)) / plugin->rows * plugin->ratio * n_cols);
}