1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
--- xfce4-panel-4.14.0-orig/plugins/pager/pager.c 2019-09-05 17:11:16.690993341 +0200
+++ xfce4-panel-4.14.0/plugins/pager/pager.c 2019-09-05 17:09:02.205850264 +0200
@@ -77,6 +77,7 @@
static void pager_plugin_configure_workspace_settings (GtkWidget *button);
static void pager_plugin_configure_plugin (XfcePanelPlugin *panel_plugin);
static void pager_plugin_screen_layout_changed (PagerPlugin *plugin);
+static void pager_plugin_get_ratio (PagerPlugin *plugin);
static void pager_plugin_get_preferred_width (GtkWidget *widget,
gint *minimum_width,
gint *natural_width);
@@ -527,9 +528,6 @@
g_message ("Setting the pager rows returned false. Maybe the setting is not applied.");
wnck_pager_set_orientation (WNCK_PAGER (plugin->pager), orientation);
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- plugin->ratio = (gfloat) gdk_screen_width () / (gfloat) gdk_screen_height ();
-G_GNUC_END_IGNORE_DEPRECATIONS
g_signal_connect_after (G_OBJECT (plugin->pager), "drag-begin",
G_CALLBACK (pager_plugin_drag_begin_event), plugin);
g_signal_connect_after (G_OBJECT (plugin->pager), "drag-end",
@@ -825,6 +823,26 @@
static void
+pager_plugin_get_ratio (PagerPlugin *plugin)
+{
+ WnckWorkspace *active_ws;
+
+ panel_return_if_fail (XFCE_IS_PAGER_PLUGIN (plugin));
+ panel_return_if_fail (WNCK_IS_SCREEN (plugin->wnck_screen));
+
+ active_ws = wnck_screen_get_active_workspace (plugin->wnck_screen);
+ if (wnck_workspace_is_virtual (active_ws))
+ {
+ plugin->ratio = (gfloat) wnck_workspace_get_width (active_ws) / (gfloat) wnck_workspace_get_height (active_ws);
+ }
+ else
+ {
+ plugin->ratio = (gfloat) gdk_screen_width () / (gfloat) gdk_screen_height ();
+ }
+}
+
+
+static void
pager_plugin_get_preferred_width (GtkWidget *widget,
gint *minimum_width,
gint *natural_width)
@@ -846,6 +864,9 @@
{
n_workspaces = wnck_screen_get_workspace_count (plugin->wnck_screen);
n_cols = MAX (1, (n_workspaces + plugin->rows - 1) / plugin->rows);
+
+ pager_plugin_get_ratio(plugin);
+
min_width = nat_width = (gint) (xfce_panel_plugin_get_size (XFCE_PANEL_PLUGIN (plugin)) / plugin->rows * plugin->ratio * n_cols);
}
@@ -877,6 +898,9 @@
{
n_workspaces = wnck_screen_get_workspace_count (plugin->wnck_screen);
n_cols = MAX (1, (n_workspaces + plugin->rows - 1) / plugin->rows);
+
+ pager_plugin_get_ratio(plugin);
+
if (mode == XFCE_PANEL_PLUGIN_MODE_VERTICAL)
min_height = nat_height = (gint) (xfce_panel_plugin_get_size (XFCE_PANEL_PLUGIN (plugin)) / plugin->rows / plugin->ratio * n_cols);
else /* (mode == XFCE_PANEL_PLUGIN_MODE_DESKBAR) */
|