~ubuntu-branches/ubuntu/raring/metacity/raring

« back to all changes in this revision

Viewing changes to src/ui/tabpopup.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-08-23 11:12:43 UTC
  • mfrom: (1.2.64) (2.1.13 quantal-proposed)
  • Revision ID: package-import@ubuntu.com-20120823111243-v2ome3yisozc1dhw
* Resync with Debian & refresh patches. (LP: #1032120, LP: #1035261)
  Remaining changes:
* debian/control:
  - Suggest gnome-themes-standard instead of recommend
  - Add Vcs-Bzr link
* debian/metacity-common.gsettings-override:
  - Set Ubuntu default button layout order for Classic session
  - Drop previous gconf overrides as obsolete
* debian/patches/04_support_drag_drop_with_alt_tab.patch:
  - Support alt-tab during drag and drop.
* debian/patches/05_raise_on_click_for_click_mode.patch:
  - Use raise on click option.
* debian/patches/06_Add_UXD_shadows_and_borders.patch:
  - patch for a new key in the ubuntu theme for shows and borders
* debian/patches/10_no-ws-switcher.patch:
  - Don't show the workspace switcher if we only have one.
* debian/patches/12_dont-show-as-user.patch:
  - Don't show "as user" in title bar.
* debian/patches/13_better_support_for_button_layout.patch:
  - Corrected support for buttons backgrounds with transparency
* debian/patches/14_wrong_colormap.patch:
  - Use correct colormap to avoid crash with client side decorations
* debian/patches/20_do-not-place-windows-over-the-launcher.patch:
  - Try to avoid an already visible launcher in intellihide mode when
    initially positioning new windows.
* debian/patches/21_fix_compositing_startup.patch:
  Fix some weird rendering effect at startup with compositing activated
* debian/patches/100_fade_on_long_title.patch:
  - Fade on the end if the title is too long.
* debian/patches/102_workarea.patch,
  debian/patches/103_struts_in_the_middle.patch,
  debian/patches/104_workarea_union.patch:
  - Add barriers and multimonitor strut support for unity-2d
* debian/patches/104_workarea_union.patch:
  - Ensure each screen_region generated by
    meta_rectangle_get_minimal_spanning_set_for_region is not outside
    the xinerama screens
* Dropped patch:
  - 11_hide_tooltip_on_decorator.patch: Obsolete
* debian/patches/03_strict_focus.patch:
  - Disabled. This needs gsettings-desktop-schemas to be patched if
    we want to bring this back
* Disabled Unity 2D-related patches that need porting to gsettings:
  - 15_show_maximized_titlebars.patch
  - 16-capture-before-unmap.patch
  - 17-workspace-switcher-cycle.patch
  - 18-auto-maximize-windows.patch
  - 19_add_unity_hud_configuration.patch
  - 101_override_gconf_settings.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
442
442
    }
443
443
  else
444
444
    {
445
 
      if (GTK_WIDGET_VISIBLE (popup->window))
 
445
      if (gtk_widget_get_visible (popup->window))
446
446
        {
447
447
          meta_verbose ("Hiding tab popup window\n");
448
448
          gtk_widget_hide (popup->window);
458
458
  GdkRectangle rect;
459
459
  GdkRegion *region;
460
460
  GdkRegion *inner_region;
 
461
  GdkWindow *window;
461
462
 
462
463
  
463
464
  if (popup->current_selected_entry)
477
478
 
478
479
  if (popup->outline)
479
480
    {
 
481
      window = gtk_widget_get_window (popup->outline_window);
 
482
 
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 ()));
483
486
  
484
487
      rect = te->rect;
485
488
      rect.x = 0;
486
489
      rect.y = 0;
487
490
 
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);
491
494
  
492
 
      gdk_window_set_background (popup->outline_window->window,
493
 
                                 &popup->outline_window->style->black);
 
495
      gdk_window_set_background (window,
 
496
                                 &gtk_widget_get_style (popup->outline_window)->black);
494
497
  
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);
499
502
  
500
 
      gdk_window_shape_combine_region (popup->outline_window->window,
 
503
      gdk_window_shape_combine_region (window,
501
504
                                       region,
502
505
                                       0, 0);
503
506
 
508
511
       * we manually set the window as mapped and then manually map it
509
512
       * with gdk functions.
510
513
       */
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);
513
516
    }
514
517
 
515
518
  /* Must be before we handle an expose for the outline window */
694
697
{
695
698
  if (META_SELECT_IMAGE (widget)->selected)
696
699
    {
697
 
      int x, y, w, h;
 
700
      GtkAllocation allocation;
 
701
      GtkRequisition requisition;
698
702
      GtkMisc *misc;
699
703
      GtkStyle *style;
700
704
      GtkStateType state;
 
705
      GdkWindow *window;
 
706
      int x, y, w, h;
 
707
      int xpad, ypad;
 
708
      float xalign, yalign;
701
709
      cairo_t *cr;
702
710
 
703
711
      misc = GTK_MISC (widget);
704
712
      
705
 
      x = (widget->allocation.x * (1.0 - misc->xalign) +
706
 
           (widget->allocation.x + widget->allocation.width
707
 
            - (widget->requisition.width - misc->xpad * 2)) *
708
 
           misc->xalign) + 0.5;
709
 
      y = (widget->allocation.y * (1.0 - misc->yalign) +
710
 
           (widget->allocation.y + widget->allocation.height
711
 
            - (widget->requisition.height - misc->ypad * 2)) *
712
 
           misc->yalign) + 0.5;
 
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);
 
717
 
 
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;
713
724
 
714
725
      x -= INSIDE_SELECT_RECT + 1;
715
726
      y -= INSIDE_SELECT_RECT + 1;      
716
727
      
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;
719
730
 
 
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);
723
735
 
724
736
      cairo_set_line_width (cr, 2.0);
725
737
      gdk_cairo_set_source_color (cr, &style->fg[state]);
889
901
{
890
902
  MetaWorkspace *workspace;
891
903
  WnckWindowDisplayInfo *windows;
 
904
  GtkAllocation allocation;
892
905
  GtkStyle *style;
 
906
  GdkWindow *window;
893
907
  cairo_t *cr;
894
908
  int i, n_windows;
895
909
  GList *tmp, *list;
929
943
 
930
944
  g_list_free (list);
931
945
 
 
946
  window = gtk_widget_get_window (widget);
 
947
  gtk_widget_get_allocation (widget, &allocation);
 
948
 
932
949
  wnck_draw_workspace (widget,
933
 
                       widget->window,
934
 
                       SELECT_OUTLINE_WIDTH,
935
 
                       SELECT_OUTLINE_WIDTH,
936
 
                       widget->allocation.width - SELECT_OUTLINE_WIDTH * 2,
937
 
                       widget->allocation.height - SELECT_OUTLINE_WIDTH * 2,
 
950
                       window,
 
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,
940
957
                       NULL,
947
964
  if (META_SELECT_WORKSPACE (widget)->selected)
948
965
    {
949
966
      style = gtk_widget_get_style (widget);
950
 
      cr = gdk_cairo_create (widget->window);
 
967
      cr = gdk_cairo_create (window);
951
968
 
952
969
      gdk_cairo_set_source_color (cr,
953
970
                                  &style->fg[gtk_widget_get_state (widget)]);
955
972
 
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);
961
978
 
962
979
      cairo_destroy (cr);