3
* Copyright (c) 2005-2007 Jasper Huijsmans <jasper@xfce.org>
4
* Copyright (c) 2007 Nick Schermer <nick@xfce.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU Library General Public License as published
8
* by the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU Library General Public License for more details.
2
* Copyright (C) 2008-2009 Nick Schermer <nick@xfce.org>
4
* This library is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the Free
6
* Software Foundation; either version 2 of the License, or (at your option)
9
* This library is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16
14
* You should have received a copy of the GNU Library General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15
* along with this library; if not, write to the Free Software Foundation,
16
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21
19
#ifdef HAVE_CONFIG_H
22
20
#include <config.h>
24
#include <libxfce4ui/libxfce4ui.h>
25
#include <common/panel-xfconf.h>
26
#include <common/panel-utils.h>
27
#include <common/panel-private.h>
28
#include <libxfce4panel/libxfce4panel.h>
30
#include "tasklist-widget.h"
31
#include "tasklist-dialog_ui.h"
33
/* TODO move to header */
34
GType tasklist_plugin_get_type (void) G_GNUC_CONST;
35
void tasklist_plugin_register_type (XfcePanelTypeModule *type_module);
36
#define XFCE_TYPE_TASKLIST_PLUGIN (tasklist_plugin_get_type ())
37
#define XFCE_TASKLIST_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_TYPE_TASKLIST_PLUGIN, TasklistPlugin))
38
#define XFCE_TASKLIST_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_TYPE_TASKLIST_PLUGIN, TasklistPluginClass))
39
#define XFCE_IS_TASKLIST_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_TYPE_TASKLIST_PLUGIN))
40
#define XFCE_IS_TASKLIST_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFCE_TYPE_TASKLIST_PLUGIN))
41
#define XFCE_TASKLIST_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_TYPE_TASKLIST_PLUGIN, TasklistPluginClass))
44
typedef struct _TasklistPluginClass TasklistPluginClass;
45
struct _TasklistPluginClass
47
XfcePanelPluginClass __parent__;
50
typedef struct _TasklistPlugin TasklistPlugin;
51
struct _TasklistPlugin
53
XfcePanelPlugin __parent__;
55
/* the tasklist widget */
62
static void tasklist_plugin_construct (XfcePanelPlugin *panel_plugin);
63
static void tasklist_plugin_orientation_changed (XfcePanelPlugin *panel_plugin,
64
GtkOrientation orientation);
65
static gboolean tasklist_plugin_size_changed (XfcePanelPlugin *panel_plugin,
67
static void tasklist_plugin_configure_plugin (XfcePanelPlugin *panel_plugin);
68
static gboolean tasklist_plugin_handle_expose_event (GtkWidget *widget,
69
GdkEventExpose *event,
70
TasklistPlugin *plugin);
74
/* define and register the plugin */
75
XFCE_PANEL_DEFINE_PLUGIN_RESIDENT (TasklistPlugin, tasklist_plugin)
80
tasklist_plugin_class_init (TasklistPluginClass *klass)
82
XfcePanelPluginClass *plugin_class;
84
plugin_class = XFCE_PANEL_PLUGIN_CLASS (klass);
85
plugin_class->construct = tasklist_plugin_construct;
86
plugin_class->orientation_changed = tasklist_plugin_orientation_changed;
87
plugin_class->size_changed = tasklist_plugin_size_changed;
88
plugin_class->configure_plugin = tasklist_plugin_configure_plugin;
94
tasklist_plugin_init (TasklistPlugin *plugin)
99
box = xfce_hvbox_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
100
gtk_container_add (GTK_CONTAINER (plugin), box);
101
exo_binding_new (G_OBJECT (plugin), "orientation", G_OBJECT (box), "orientation");
102
gtk_widget_show (box);
104
plugin->handle = gtk_alignment_new (0.00, 0.00, 0.00, 0.00);
105
gtk_box_pack_start (GTK_BOX (box), plugin->handle, FALSE, FALSE, 0);
106
g_signal_connect (G_OBJECT (plugin->handle), "expose-event",
107
G_CALLBACK (tasklist_plugin_handle_expose_event), plugin);
108
gtk_widget_set_size_request (plugin->handle, 8, 8);
109
gtk_widget_show (plugin->handle);
111
plugin->tasklist = g_object_new (XFCE_TYPE_TASKLIST, NULL);
112
gtk_box_pack_start (GTK_BOX (box), plugin->tasklist, TRUE, TRUE, 0);
114
exo_binding_new (G_OBJECT (plugin->tasklist), "show-handle",
115
G_OBJECT (plugin->handle), "visible");
121
tasklist_plugin_construct (XfcePanelPlugin *panel_plugin)
123
TasklistPlugin *plugin = XFCE_TASKLIST_PLUGIN (panel_plugin);
124
const PanelProperty properties[] =
126
{ "show-labels", G_TYPE_BOOLEAN },
127
{ "grouping", G_TYPE_UINT },
128
{ "include-all-workspaces", G_TYPE_BOOLEAN },
129
{ "flat-buttons", G_TYPE_BOOLEAN },
130
{ "switch-workspace-on-unminimize", G_TYPE_BOOLEAN },
131
{ "show-only-minimized", G_TYPE_BOOLEAN },
132
{ "show-wireframes", G_TYPE_BOOLEAN },
133
{ "show-handle", G_TYPE_BOOLEAN },
134
{ "sort-order", G_TYPE_UINT },
135
{ "rotate-vertically", G_TYPE_BOOLEAN },
140
xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
142
/* expand the plugin */
143
xfce_panel_plugin_set_expand (panel_plugin, TRUE);
145
/* bind all properties */
146
panel_properties_bind (NULL, G_OBJECT (plugin->tasklist),
147
xfce_panel_plugin_get_property_base (panel_plugin),
150
/* show the tasklist */
151
gtk_widget_show (plugin->tasklist);
157
tasklist_plugin_orientation_changed (XfcePanelPlugin *panel_plugin,
158
GtkOrientation orientation)
160
TasklistPlugin *plugin = XFCE_TASKLIST_PLUGIN (panel_plugin);
162
/* set the new tasklist orientation */
163
xfce_tasklist_set_orientation (XFCE_TASKLIST (plugin->tasklist), orientation);
169
tasklist_plugin_size_changed (XfcePanelPlugin *panel_plugin,
172
TasklistPlugin *plugin = XFCE_TASKLIST_PLUGIN (panel_plugin);
174
/* set the tasklist size */
175
xfce_tasklist_set_size (XFCE_TASKLIST (plugin->tasklist), size);
183
tasklist_plugin_configure_plugin (XfcePanelPlugin *panel_plugin)
185
TasklistPlugin *plugin = XFCE_TASKLIST_PLUGIN (panel_plugin);
191
/* setup the dialog */
193
builder = panel_utils_builder_new (panel_plugin, tasklist_dialog_ui,
194
tasklist_dialog_ui_length, &dialog);
195
if (G_UNLIKELY (builder == NULL))
198
#define TASKLIST_DIALOG_BIND(name, property) \
199
object = gtk_builder_get_object (builder, (name)); \
200
panel_return_if_fail (G_IS_OBJECT (object)); \
201
exo_mutual_binding_new (G_OBJECT (plugin->tasklist), (name), \
202
G_OBJECT (object), (property));
204
#define TASKLIST_DIALOG_BIND_INV(name, property) \
205
object = gtk_builder_get_object (builder, (name)); \
206
panel_return_if_fail (G_IS_OBJECT (object)); \
207
exo_mutual_binding_new_with_negation (G_OBJECT (plugin->tasklist), \
208
name, G_OBJECT (object), \
211
TASKLIST_DIALOG_BIND ("show-labels", "active")
212
TASKLIST_DIALOG_BIND ("grouping", "active")
213
TASKLIST_DIALOG_BIND ("include-all-workspaces", "active")
214
TASKLIST_DIALOG_BIND ("flat-buttons", "active")
215
TASKLIST_DIALOG_BIND ("rotate-vertically", "active")
216
TASKLIST_DIALOG_BIND_INV ("switch-workspace-on-unminimize", "active")
217
TASKLIST_DIALOG_BIND ("show-only-minimized", "active")
218
TASKLIST_DIALOG_BIND ("show-wireframes", "active")
219
TASKLIST_DIALOG_BIND ("show-handle", "active")
220
TASKLIST_DIALOG_BIND ("sort-order", "active")
222
#ifndef GDK_WINDOWING_X11
223
/* not functional in x11, so avoid confusion */
224
object = gtk_builder_get_object (builder, "show-wireframes");
225
gtk_widget_hide (GTK_WIDGET (object));
29
#include <libwnck/libwnck.h>
30
#include <libxfce4util/libxfce4util.h>
31
#include <libxfce4panel/xfce-hvbox.h>
34
#include "tasklist-dialogs.h"
36
#define TASKLIST_HANDLE_SIZE (8)
40
static gboolean tasklist_handle_exposed (GtkWidget *widget,
41
GdkEventExpose *event,
42
TasklistPlugin *tasklist);
43
static GdkPixbuf *tasklist_icon_loader (const gchar *name,
46
TasklistPlugin *tasklist);
47
static TasklistPlugin *tasklist_plugin_new (XfcePanelPlugin *panel_plugin);
48
static void tasklist_plugin_screen_changed (TasklistPlugin *tasklist,
49
GdkScreen *previous_screen);
50
static void tasklist_plugin_orientation_changed (TasklistPlugin *tasklist,
51
GtkOrientation orientation);
52
static gboolean tasklist_plugin_size_changed (TasklistPlugin *tasklist,
54
static void tasklist_plugin_size_request (TasklistPlugin *tasklist,
55
GtkRequisition *requisition);
56
static void tasklist_plugin_read (TasklistPlugin *tasklist);
57
static void tasklist_plugin_free (TasklistPlugin *tasklist);
58
static void tasklist_plugin_construct (XfcePanelPlugin *panel_plugin);
62
/* register with the panel */
63
XFCE_PANEL_PLUGIN_REGISTER_INTERNAL (tasklist_plugin_construct);
68
tasklist_using_xinerama (XfcePanelPlugin *panel_plugin)
70
return (gdk_screen_get_n_monitors (gtk_widget_get_screen (GTK_WIDGET (panel_plugin))) > 1);
228
/* TODO: remove this if always group is supported */
229
object = gtk_builder_get_object (builder, "grouping-model");
230
if (gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (object), &iter, NULL, 2))
231
gtk_list_store_remove (GTK_LIST_STORE (object), &iter);
233
gtk_widget_show (GTK_WIDGET (dialog));
76
tasklist_handle_exposed (GtkWidget *widget,
77
GdkEventExpose *event,
78
TasklistPlugin *tasklist)
239
tasklist_plugin_handle_expose_event (GtkWidget *widget,
240
GdkEventExpose *event,
241
TasklistPlugin *plugin)
80
GtkOrientation orientation;
83
if (GTK_WIDGET_DRAWABLE (widget))
85
/* get the panel orientation */
86
orientation = xfce_panel_plugin_get_orientation (tasklist->panel_plugin);
89
x = widget->allocation.x;
90
y = widget->allocation.y;
91
w = widget->allocation.width;
92
h = widget->allocation.height;
94
if (orientation == GTK_ORIENTATION_HORIZONTAL)
96
y += widget->style->ythickness;
97
h -= 2 * widget->style->ythickness;
101
x += widget->style->xthickness;
102
w -= 2 * widget->style->xthickness;
105
gtk_paint_handle (widget->style, widget->window,
106
GTK_WIDGET_STATE (widget), GTK_SHADOW_NONE,
107
&(event->area), widget, "handlebox",
109
orientation == GTK_ORIENTATION_HORIZONTAL ?
110
GTK_ORIENTATION_VERTICAL :
111
GTK_ORIENTATION_HORIZONTAL);
243
GtkOrientation orientation;
245
panel_return_val_if_fail (XFCE_IS_TASKLIST_PLUGIN (plugin), FALSE);
246
panel_return_val_if_fail (plugin->handle == widget, FALSE);
248
if (!GTK_WIDGET_DRAWABLE (widget))
122
tasklist_icon_loader (const gchar *name,
125
TasklistPlugin *tasklist)
127
GdkPixbuf *pixbuf = NULL;
131
/* do nothing on invalid names */
132
if (G_UNLIKELY (name == NULL || *name == '\0'))
135
if (g_path_is_absolute (name))
137
if (g_file_test (name, G_FILE_TEST_EXISTS))
139
/* directly load the file */
140
pixbuf = gdk_pixbuf_new_from_file_at_size (name, size, size, NULL);
144
/* get the base name */
145
base = g_path_get_basename (name);
147
/* use this function to try again */
148
pixbuf = tasklist_icon_loader (base, size, flags, tasklist);
157
p = strrchr (name, '.');
159
base = g_strndup (name, p - name);
162
pixbuf = gtk_icon_theme_load_icon (tasklist->icon_theme, base ? base : name, size, 0, NULL);
173
static TasklistPlugin *
174
tasklist_plugin_new (XfcePanelPlugin *panel_plugin)
176
TasklistPlugin *tasklist;
180
/* allocate structure */
181
tasklist = panel_slice_new0 (TasklistPlugin);
184
tasklist->panel_plugin = panel_plugin;
187
tasklist_plugin_read (tasklist);
190
tasklist->box = xfce_hvbox_new (xfce_panel_plugin_get_orientation (panel_plugin), FALSE, 0);
191
gtk_container_add (GTK_CONTAINER (panel_plugin), tasklist->box);
192
gtk_widget_show (tasklist->box);
195
tasklist->handle = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
196
gtk_widget_set_size_request (tasklist->handle, TASKLIST_HANDLE_SIZE, TASKLIST_HANDLE_SIZE);
197
gtk_box_pack_start (GTK_BOX (tasklist->box), tasklist->handle, FALSE, FALSE, 0);
198
g_signal_connect (tasklist->handle, "expose-event", G_CALLBACK (tasklist_handle_exposed), tasklist);
199
if (tasklist->show_handles)
200
gtk_widget_show (tasklist->handle);
202
/* get the current screen number */
203
screen = gtk_widget_get_screen (GTK_WIDGET (panel_plugin));
204
screen_n = gdk_screen_get_number (screen);
206
/* set the icon theme */
207
tasklist->icon_theme = gtk_icon_theme_get_for_screen (screen);
209
/* create tasklist */
210
tasklist->list = wnck_tasklist_new (wnck_screen_get (screen_n));
211
gtk_box_pack_start (GTK_BOX (tasklist->box), tasklist->list, FALSE, FALSE, 0);
212
gtk_widget_show (tasklist->list);
214
/* set the tasklist settings */
215
wnck_tasklist_set_include_all_workspaces (WNCK_TASKLIST (tasklist->list), tasklist->all_workspaces);
216
wnck_tasklist_set_grouping (WNCK_TASKLIST (tasklist->list), tasklist->grouping);
217
wnck_tasklist_set_button_relief (WNCK_TASKLIST (tasklist->list), tasklist->flat_buttons ? GTK_RELIEF_NONE : GTK_RELIEF_NORMAL);
218
wnck_tasklist_set_icon_loader (WNCK_TASKLIST (tasklist->list), (WnckLoadIconFunction) tasklist_icon_loader, tasklist, NULL);
226
tasklist_plugin_screen_changed (TasklistPlugin *tasklist,
227
GdkScreen *previous_screen)
230
WnckScreen *wnck_screen;
232
/* get the new screen */
233
screen = gtk_widget_get_screen (GTK_WIDGET (tasklist->panel_plugin));
234
if (G_UNLIKELY (screen == NULL))
235
screen = gdk_screen_get_default ();
237
/* get the wnck screen */
238
wnck_screen = wnck_screen_get (gdk_screen_get_number (screen));
240
/* set the new tasklist screen */
241
wnck_tasklist_set_screen (WNCK_TASKLIST (tasklist->list), wnck_screen);
243
/* set the icon theme */
244
tasklist->icon_theme = gtk_icon_theme_get_for_screen (screen);
250
tasklist_plugin_orientation_changed (TasklistPlugin *tasklist,
251
GtkOrientation orientation)
253
/* set the new orientation of the hvbox */
254
xfce_hvbox_set_orientation (XFCE_HVBOX (tasklist->box), orientation);
256
/* redraw the handle */
257
gtk_widget_queue_draw (tasklist->handle);
263
tasklist_plugin_size_changed (TasklistPlugin *tasklist,
266
/* size is handled in the size_request function */
273
tasklist_plugin_size_request (TasklistPlugin *tasklist,
274
GtkRequisition *requisition)
276
const gint *size_hints;
279
GtkOrientation orientation;
281
/* get the size hints */
282
size_hints = wnck_tasklist_get_size_hint_list (WNCK_TASKLIST (tasklist->list), &length);
284
/* check for pairs of 2 */
285
if (G_LIKELY (length > 0))
287
/* get the first size */
288
size = size_hints[0];
290
/* add the handle size */
291
if (tasklist->show_handles)
292
size += TASKLIST_HANDLE_SIZE;
294
/* use the requested size when it is bigger then the prefered size */
295
if (tasklist->fixed_width)
296
size = MAX (100, tasklist->width);
298
/* get plugin orientation */
299
orientation = xfce_panel_plugin_get_orientation (tasklist->panel_plugin);
301
/* set the panel size */
302
requisition->width = requisition->height = xfce_panel_plugin_get_size (tasklist->panel_plugin);
304
/* set the requested plugin size */
305
if (orientation == GTK_ORIENTATION_HORIZONTAL)
306
requisition->width = size;
308
requisition->height = size;
310
/* save the requested size */
311
tasklist->req_size = size;
317
tasklist_plugin_size_allocate (TasklistPlugin *tasklist,
318
GtkAllocation *allocation)
320
GtkOrientation orientation;
323
/* get orientation */
324
orientation = xfce_panel_plugin_get_orientation (tasklist->panel_plugin);
326
/* get plugin size */
327
p_size = xfce_panel_plugin_get_size (tasklist->panel_plugin);
329
if (orientation == GTK_ORIENTATION_HORIZONTAL)
330
a_size = MIN (tasklist->req_size, allocation->width);
332
a_size = MIN (tasklist->req_size, allocation->height);
334
if (tasklist->show_handles)
335
a_size -= TASKLIST_HANDLE_SIZE;
337
/* force the size request of the taskbar */
338
if (orientation == GTK_ORIENTATION_HORIZONTAL)
339
gtk_widget_set_size_request (GTK_WIDGET (tasklist->list), a_size, p_size);
341
gtk_widget_set_size_request (GTK_WIDGET (tasklist->list), p_size, a_size);
346
tasklist_plugin_read (TasklistPlugin *tasklist)
352
tasklist->grouping = WNCK_TASKLIST_AUTO_GROUP;
353
tasklist->all_workspaces = FALSE;
354
tasklist->expand = TRUE;
355
tasklist->flat_buttons = TRUE;
356
tasklist->show_handles = TRUE;
357
tasklist->width = 300;
358
tasklist->fixed_width = FALSE;
360
/* get rc file name */
361
file = xfce_panel_plugin_lookup_rc_file (tasklist->panel_plugin);
365
/* open the file, readonly */
366
rc = xfce_rc_simple_open (file, TRUE);
374
tasklist->grouping = xfce_rc_read_int_entry (rc, "grouping", tasklist->grouping);
375
tasklist->all_workspaces = xfce_rc_read_bool_entry (rc, "all_workspaces", tasklist->all_workspaces);
376
tasklist->flat_buttons = xfce_rc_read_bool_entry (rc, "flat_buttons", tasklist->flat_buttons);
377
tasklist->show_handles = xfce_rc_read_bool_entry (rc, "show_handles", tasklist->show_handles);
378
tasklist->width = xfce_rc_read_int_entry (rc, "width",tasklist->width);
379
tasklist->fixed_width = xfce_rc_read_bool_entry (rc, "fixed_width", tasklist->fixed_width);
381
/* only set expand flag if xinerama is used */
382
if (tasklist_using_xinerama (tasklist->panel_plugin))
383
tasklist->expand = xfce_rc_read_bool_entry (rc, "expand", tasklist->expand);
385
/* close the rc file */
394
tasklist_plugin_write (TasklistPlugin *tasklist)
399
/* get rc file name, create it if needed */
400
file = xfce_panel_plugin_save_location (tasklist->panel_plugin, TRUE);
404
/* open the file, writable */
405
rc = xfce_rc_simple_open (file, FALSE);
413
xfce_rc_write_int_entry (rc, "grouping", tasklist->grouping);
414
xfce_rc_write_int_entry (rc, "width", tasklist->width);
415
xfce_rc_write_bool_entry (rc, "all_workspaces", tasklist->all_workspaces);
416
xfce_rc_write_bool_entry (rc, "expand", tasklist->expand);
417
xfce_rc_write_bool_entry (rc, "flat_buttons", tasklist->flat_buttons);
418
xfce_rc_write_bool_entry (rc, "show_handles", tasklist->show_handles);
419
xfce_rc_write_bool_entry (rc, "fixed_width", tasklist->fixed_width);
421
/* close the rc file */
430
tasklist_plugin_free (TasklistPlugin *tasklist)
434
/* destroy the dialog */
435
dialog = g_object_get_data (G_OBJECT (tasklist->panel_plugin), I_("dialog"));
437
gtk_widget_destroy (dialog);
439
/* disconnect screen changed signal */
440
g_signal_handler_disconnect (G_OBJECT (tasklist->panel_plugin), tasklist->screen_changed_id);
443
panel_slice_free (TasklistPlugin, tasklist);
449
tasklist_plugin_construct (XfcePanelPlugin *panel_plugin)
451
TasklistPlugin *tasklist;
453
/* create the tray panel plugin */
454
tasklist = tasklist_plugin_new (panel_plugin);
456
/* set the action widgets and show configure */
457
xfce_panel_plugin_add_action_widget (panel_plugin, tasklist->handle);
458
xfce_panel_plugin_menu_show_configure (panel_plugin);
460
/* whether to expand the plugin */
461
xfce_panel_plugin_set_expand (panel_plugin, tasklist->expand);
463
/* connect plugin signals */
464
g_signal_connect_swapped (G_OBJECT (panel_plugin), "orientation-changed",
465
G_CALLBACK (tasklist_plugin_orientation_changed), tasklist);
466
g_signal_connect_swapped (G_OBJECT (panel_plugin), "size-changed",
467
G_CALLBACK (tasklist_plugin_size_changed), tasklist);
468
g_signal_connect_swapped (G_OBJECT (panel_plugin), "size-request",
469
G_CALLBACK (tasklist_plugin_size_request), tasklist);
470
g_signal_connect_swapped (G_OBJECT (panel_plugin), "size-allocate",
471
G_CALLBACK (tasklist_plugin_size_allocate), tasklist);
472
g_signal_connect_swapped (G_OBJECT (panel_plugin), "save",
473
G_CALLBACK (tasklist_plugin_write), tasklist);
474
g_signal_connect_swapped (G_OBJECT (panel_plugin), "free-data",
475
G_CALLBACK (tasklist_plugin_free), tasklist);
476
g_signal_connect_swapped (G_OBJECT (panel_plugin), "configure-plugin",
477
G_CALLBACK (tasklist_dialogs_configure), tasklist);
479
/* screen changed signal */
480
tasklist->screen_changed_id =
481
g_signal_connect_swapped (G_OBJECT (panel_plugin), "screen-changed",
482
G_CALLBACK (tasklist_plugin_screen_changed), tasklist);
251
/* get the orientation */
252
if (xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) ==
253
GTK_ORIENTATION_HORIZONTAL)
254
orientation = GTK_ORIENTATION_VERTICAL;
256
orientation = GTK_ORIENTATION_HORIZONTAL;
258
/* paint the handle */
259
gtk_paint_handle (widget->style, widget->window,
260
GTK_WIDGET_STATE (widget), GTK_SHADOW_NONE,
261
&(event->area), widget, "handlebox",
262
widget->allocation.x,
263
widget->allocation.y,
264
widget->allocation.width,
265
widget->allocation.height,