478
479
if (popup->outline)
481
window = gtk_widget_get_window (popup->outline_window);
480
483
/* Do stuff behind gtk's back */
481
gdk_window_hide (popup->outline_window->window);
484
gdk_window_hide (window);
482
485
meta_core_increment_event_serial (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
488
gdk_window_move_resize (popup->outline_window->window,
491
gdk_window_move_resize (window,
489
492
te->rect.x, te->rect.y,
490
493
te->rect.width, te->rect.height);
492
gdk_window_set_background (popup->outline_window->window,
493
&popup->outline_window->style->black);
495
gdk_window_set_background (window,
496
>k_widget_get_style (popup->outline_window)->black);
495
498
region = gdk_region_rectangle (&rect);
496
499
inner_region = gdk_region_rectangle (&te->inner_rect);
497
500
gdk_region_subtract (region, inner_region);
498
501
gdk_region_destroy (inner_region);
500
gdk_window_shape_combine_region (popup->outline_window->window,
503
gdk_window_shape_combine_region (window,
508
511
* we manually set the window as mapped and then manually map it
509
512
* with gdk functions.
511
GTK_WIDGET_SET_FLAGS (popup->outline_window, GTK_MAPPED);
512
gdk_window_show_unraised (popup->outline_window->window);
514
gtk_widget_set_mapped (popup->outline_window, TRUE);
515
gdk_window_show_unraised (window);
515
518
/* Must be before we handle an expose for the outline window */
695
698
if (META_SELECT_IMAGE (widget)->selected)
700
GtkAllocation allocation;
701
GtkRequisition requisition;
700
704
GtkStateType state;
708
float xalign, yalign;
703
711
misc = GTK_MISC (widget);
705
x = (widget->allocation.x * (1.0 - misc->xalign) +
706
(widget->allocation.x + widget->allocation.width
707
- (widget->requisition.width - misc->xpad * 2)) *
709
y = (widget->allocation.y * (1.0 - misc->yalign) +
710
(widget->allocation.y + widget->allocation.height
711
- (widget->requisition.height - misc->ypad * 2)) *
713
gtk_widget_get_allocation (widget, &allocation);
714
gtk_widget_get_requisition (widget, &requisition);
715
gtk_misc_get_padding (misc, &xpad, &ypad);
716
gtk_misc_get_alignment (misc, &xalign, &yalign);
718
x = (allocation.x * (1.0 - xalign) +
719
(allocation.x + allocation.width
720
- (requisition.width - xpad * 2)) * xalign) + 0.5;
721
y = (allocation.y * (1.0 - yalign) +
722
(allocation.y + allocation.height
723
- (requisition.height - ypad * 2)) * yalign) + 0.5;
714
725
x -= INSIDE_SELECT_RECT + 1;
715
726
y -= INSIDE_SELECT_RECT + 1;
717
w = widget->requisition.width - OUTSIDE_SELECT_RECT * 2 - 1;
718
h = widget->requisition.height - OUTSIDE_SELECT_RECT * 2 - 1;
728
w = requisition.width - OUTSIDE_SELECT_RECT * 2 - 1;
729
h = requisition.height - OUTSIDE_SELECT_RECT * 2 - 1;
731
window = gtk_widget_get_window (widget);
720
732
style = gtk_widget_get_style (widget);
721
733
state = gtk_widget_get_state (widget);
722
cr = gdk_cairo_create (widget->window);
734
cr = gdk_cairo_create (window);
724
736
cairo_set_line_width (cr, 2.0);
725
737
gdk_cairo_set_source_color (cr, &style->fg[state]);
930
944
g_list_free (list);
946
window = gtk_widget_get_window (widget);
947
gtk_widget_get_allocation (widget, &allocation);
932
949
wnck_draw_workspace (widget,
934
SELECT_OUTLINE_WIDTH,
935
SELECT_OUTLINE_WIDTH,
936
widget->allocation.width - SELECT_OUTLINE_WIDTH * 2,
937
widget->allocation.height - SELECT_OUTLINE_WIDTH * 2,
951
SELECT_OUTLINE_WIDTH,
952
SELECT_OUTLINE_WIDTH,
953
allocation.width - SELECT_OUTLINE_WIDTH * 2,
954
allocation.height - SELECT_OUTLINE_WIDTH * 2,
938
955
workspace->screen->rect.width,
939
956
workspace->screen->rect.height,
947
964
if (META_SELECT_WORKSPACE (widget)->selected)
949
966
style = gtk_widget_get_style (widget);
950
cr = gdk_cairo_create (widget->window);
967
cr = gdk_cairo_create (window);
952
969
gdk_cairo_set_source_color (cr,
953
970
&style->fg[gtk_widget_get_state (widget)]);
956
973
cairo_rectangle (cr,
957
974
SELECT_OUTLINE_WIDTH / 2.0, SELECT_OUTLINE_WIDTH / 2.0,
958
widget->allocation.width - SELECT_OUTLINE_WIDTH,
959
widget->allocation.height - SELECT_OUTLINE_WIDTH);
975
allocation.width - SELECT_OUTLINE_WIDTH,
976
allocation.height - SELECT_OUTLINE_WIDTH);
960
977
cairo_stroke (cr);
962
979
cairo_destroy (cr);