241
241
gwd_theme_get_event_window_position (gwd_theme, d, i, j, width, height,
244
/* Reparenting mode - create boxes which we monitor motionnotify on */
247
BoxPtr box = &d->event_windows[i][j].pos;
253
244
/* Pixmap mode with window geometry - create small event windows */
254
else if (!d->frame_window && w != 0 && h != 0)
245
if (w != 0 && h != 0)
256
247
XMapWindow (xdisplay, d->event_windows[i][j].window);
257
248
XMoveResizeWindow (xdisplay, d->event_windows[i][j].window,
260
251
/* No parent and no geometry - unmap all event windows */
261
else if (!d->frame_window)
263
254
XUnmapWindow (xdisplay, d->event_windows[i][j].window);
285
276
WNCK_WINDOW_ACTION_UNSTICK
288
/* Reparenting mode - if a box was set and we no longer need it reset its geometry */
289
if (d->frame_window &&
290
button_actions[i] && !(actions & button_actions[i]))
292
memset (&d->button_windows[i].pos, 0, sizeof (Box));
294
279
/* Pixmap mode - if a box was set and we no longer need it unmap its window */
295
else if (!d->frame_window &&
296
button_actions[i] && !(actions & button_actions[i]))
280
if (button_actions[i] && !(actions & button_actions[i]))
298
282
XUnmapWindow (xdisplay, d->button_windows[i].window);
302
/* Reparenting mode - if there is a button position for this
303
* button then set the geometry */
304
if (d->frame_window &&
305
gwd_theme_get_button_position (gwd_theme, d, i, width, height,
308
BoxPtr box = &d->button_windows[i].pos;
314
286
/* Pixmap mode - if there is a button position for this button then map the window
315
287
* and resize it to this position */
316
else if (!d->frame_window &&
317
gwd_theme_get_button_position (gwd_theme, d, i, width, height,
288
if (gwd_theme_get_button_position (gwd_theme, d, i, width, height,
320
291
Window x11_win = d->button_windows[i].window;
321
292
XMapWindow (xdisplay, x11_win);
322
293
XMoveResizeWindow (xdisplay, x11_win, x, y, w, h);
324
else if (!d->frame_window)
326
297
XUnmapWindow (xdisplay, d->button_windows[i].window);
436
static cairo_surface_t *
437
surface_new_from_pixbuf (GdkPixbuf *pixbuf,
442
cairo_surface_t *surface;
445
width = gdk_pixbuf_get_width (pixbuf);
446
height = gdk_pixbuf_get_height (pixbuf);
448
surface = create_surface (width, height, parent);
452
cr = cairo_create (surface);
453
gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
454
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
466
462
* update_window_decoration_icon
498
494
g_object_ref (G_OBJECT (d->icon_pixbuf));
500
/* 32 bit pixmap on pixmap mode, 24 for reparenting */
502
d->icon_surface = surface_new_from_pixbuf (d->icon_pixbuf,
503
d->frame->style_window_rgb);
505
d->icon_surface = surface_new_from_pixbuf (d->icon_pixbuf,
506
d->frame->style_window_rgba);
496
d->icon_surface = surface_new_from_pixbuf (d->icon_pixbuf,
497
d->frame->style_window_rgba);
507
499
cr = cairo_create (d->icon_surface);
508
500
d->icon = cairo_pattern_create_for_surface (cairo_get_target (cr));
509
501
cairo_destroy (cr);
589
579
gdk_error_trap_push ();
591
/* Get the correct depth for the frame window in reparenting mode, otherwise
594
surface = create_native_surface_and_wrap (d->width, d->height, d->frame->style_window_rgb);
596
surface = create_native_surface_and_wrap (d->width, d->height, d->frame->style_window_rgba);
581
surface = create_native_surface_and_wrap (d->width, d->height, d->frame->style_window_rgba);
608
593
gdk_error_trap_push ();
611
buffer_surface = create_surface (d->width, d->height, d->frame->style_window_rgb);
613
buffer_surface = create_surface (d->width, d->height, d->frame->style_window_rgba);
595
buffer_surface = create_surface (d->width, d->height, d->frame->style_window_rgba);
626
608
/* Create XRender context */
627
format = get_format_for_surface (d, buffer_surface);
628
609
picture = XRenderCreatePicture (xdisplay, cairo_xlib_surface_get_drawable (buffer_surface),
610
xformat_rgba, 0, NULL);
631
612
/* Destroy the old pixmaps and pictures */
1439
1420
frame->win_extents = _shadow_extents;
1440
1421
frame->window_context_active = _shadow_context;
1441
1422
frame->window_context_inactive = _shadow_context;
1442
frame->window_context_no_shadow = _shadow_context;
1443
1423
frame->max_window_context_active = _shadow_context;
1444
1424
frame->max_window_context_inactive = _shadow_context;
1445
frame->max_window_context_no_shadow = _shadow_context;
1446
1425
frame->update_shadow = bare_frame_update_shadow;
1468
decor_context_t _window_context_no_shadow = {
1474
decor_context_t _max_window_context_no_shadow = {
1480
1447
decor_extents_t _win_extents = { 6, 6, 6, 6 };
1481
1448
decor_extents_t _max_win_extents = { 6, 6, 4, 6 };
1485
1452
frame->update_shadow = decor_frame_update_shadow;
1486
1453
frame->window_context_active = _window_context;
1487
1454
frame->window_context_inactive = _window_context;
1488
frame->window_context_no_shadow = _window_context_no_shadow;
1489
1455
frame->max_window_context_active = _max_window_context;
1490
1456
frame->max_window_context_inactive = _max_window_context;
1491
frame->max_window_context_no_shadow = _max_window_context_no_shadow;