13
13
You should have received a copy of the GNU General Public License
14
14
along with this program; if not, write to the Free Software
15
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
xfwm4 - (c) 2002-2006 Olivier Fourdan
15
Foundation, Inc., Inc., 51 Franklin Street, Fifth Floor, Boston,
19
xfwm4 - (c) 2002-2009 Olivier Fourdan
21
23
#ifdef HAVE_CONFIG_H
25
27
#ifndef WIN_ICON_SIZE
66
68
paint_selected (GtkWidget * w, GdkEventExpose * event, gpointer data)
68
gtk_paint_box (w->style, w->window,
70
gtk_draw_flat_box (w->style, w->window,
69
71
GTK_STATE_SELECTED,
73
w->allocation.x - WIN_ICON_BORDER,
74
w->allocation.y - WIN_ICON_BORDER,
75
w->allocation.width + 2 * WIN_ICON_BORDER,
76
w->allocation.height + 2 * WIN_ICON_BORDER);
77
gtk_draw_focus (w->style, w->window,
72
78
w->allocation.x - WIN_ICON_BORDER,
73
79
w->allocation.y - WIN_ICON_BORDER,
74
80
w->allocation.width + 2 * WIN_ICON_BORDER,
87
canonical = g_strdup (s);
88
g_strcanon (canonical, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", ' ');
93
canonical = g_ascii_strup (s, -1);
94
g_strcanon (canonical, "[]()0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", ' ');
89
95
g_strstrip (canonical);
90
*canonical = g_ascii_toupper (*canonical);
135
141
t->selected_callback = g_signal_connect (G_OBJECT (w), "expose-event", G_CALLBACK (paint_selected), NULL);
136
142
c = g_object_get_data (G_OBJECT (w), "client-ptr-val");
138
tabwinSetLabel (t, c->class.res_class, c->name, c->win_workspace);
144
if (FLAG_TEST (c->flags, CLIENT_FLAG_ICONIFIED))
146
classname = g_strdup_printf ("[ %s ]", c->class.res_class);
150
classname = g_strdup(c->class.res_class);
152
tabwinSetLabel (t, classname, c->name, c->win_workspace);
141
156
static GtkWidget *
142
157
createWindowIcon (Client * c)
144
159
GdkPixbuf *icon_pixbuf;
160
GdkPixbuf *icon_pixbuf_stated;
147
163
icon_pixbuf = getAppIcon (c->screen_info->display_info, c->window, WIN_ICON_SIZE, WIN_ICON_SIZE);
164
icon_pixbuf_stated = NULL;
148
165
icon = gtk_image_new ();
149
166
g_object_set_data (G_OBJECT (icon), "client-ptr-val", c);
153
gtk_image_set_from_pixbuf (GTK_IMAGE (icon), icon_pixbuf);
170
if (FLAG_TEST (c->flags, CLIENT_FLAG_ICONIFIED))
172
icon_pixbuf_stated = gdk_pixbuf_copy (icon_pixbuf);
173
gdk_pixbuf_saturate_and_pixelate (icon_pixbuf, icon_pixbuf_stated, 0.25, TRUE);
174
gtk_image_set_from_pixbuf (GTK_IMAGE (icon), icon_pixbuf_stated);
175
g_object_unref(icon_pixbuf_stated);
179
gtk_image_set_from_pixbuf (GTK_IMAGE (icon), icon_pixbuf);
154
181
g_object_unref(icon_pixbuf);
190
216
g_return_val_if_fail (n_clients > 0, NULL);
192
218
getMouseXY (screen_info, screen_info->xroot, &msx, &msy);
193
monitor = find_monitor_at_point (scr, msx, msy);
194
gdk_screen_get_monitor_geometry (scr, monitor, &monitor_sz);
219
myScreenFindMonitorAtPoint (screen_info, msx, msy, &monitor_sz);
196
221
/* add the width of the border on each side */
197
222
grid_cols = (monitor_sz.width / (WIN_ICON_SIZE + 2 * WIN_ICON_BORDER)) * 0.75;