~awn-core/awn/trunk-rewrite

« back to all changes in this revision

Viewing changes to src/awn-panel.c

  • Committer: Michal Hruby
  • Date: 2009-11-28 22:33:39 UTC
  • Revision ID: michal.mhr@gmail.com-20091128223339-09s6zhxzjr11s25s
        * src/awn-applet-manager.c:
        * src/awn-applet-manager.h:
        * src/awn-panel.c:
        Optimize the redraw during resizes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
937
937
  awn_panel_get_draw_rect (panel, &rect2, 0, 0);
938
938
 
939
939
  // invalidate only the background draw region
940
 
  gtk_widget_queue_draw_area (GTK_WIDGET (panel),
941
 
                              MIN (rect1.x, rect2.x),
942
 
                              MIN (rect1.y, rect2.y),
943
 
                              MAX (rect1.width, rect2.width),
944
 
                              MAX (rect1.height, rect2.height));
 
940
  gint end_x = MAX (rect1.x + rect1.width, rect2.x + rect2.width);
 
941
  gint end_y = MAX (rect1.y + rect1.height, rect2.y + rect2.height);
 
942
  GdkRectangle invalid_rect =
 
943
  {
 
944
    .x = MIN (rect1.x, rect2.x),
 
945
    .y = MIN (rect1.y, rect2.y),
 
946
    .width = end_x - MIN (rect1.x, rect2.x),
 
947
    .height = end_y - MIN (rect1.y, rect2.y)
 
948
  };
 
949
  gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET (panel)),
 
950
                              &invalid_rect, FALSE);
 
951
  // without this there are some artifacts on sad face & throbbers
 
952
  awn_applet_manager_redraw_throbbers (AWN_APPLET_MANAGER (priv->manager));
945
953
 
946
954
  // FIXME: should this really be done on every animation step?
947
955
  awn_panel_update_masks (GTK_WIDGET (panel), 0, 0);