~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to gdk/quartz/gdkwindow-quartz.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-09-23 09:50:04 UTC
  • mfrom: (1.5.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 129.
  • Revision ID: james.westby@ubuntu.com-20090923095004-e9xauadn4bjs5n7m
Tags: upstream-2.18.0
ImportĀ upstreamĀ versionĀ 2.18.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
348
348
}
349
349
 
350
350
void
 
351
_gdk_quartz_window_set_needs_display_in_rect (GdkWindow    *window,
 
352
                                              GdkRectangle *rect)
 
353
{
 
354
  GdkWindowObject *private;
 
355
  GdkWindowImplQuartz *impl;
 
356
 
 
357
  private = GDK_WINDOW_OBJECT (window);
 
358
  impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
 
359
 
 
360
  if (!impl->needs_display_region)
 
361
    impl->needs_display_region = gdk_region_new ();
 
362
 
 
363
  gdk_region_union_with_rect (impl->needs_display_region, rect);
 
364
 
 
365
  [impl->view setNeedsDisplayInRect:NSMakeRect (rect->x, rect->y,
 
366
                                                rect->width, rect->height)];
 
367
 
 
368
}
 
369
 
 
370
void
351
371
_gdk_windowing_window_process_updates_recurse (GdkWindow *window,
352
372
                                               GdkRegion *region)
353
373
{
354
 
  GdkWindowObject *private = (GdkWindowObject *)window;
355
 
  GdkWindowImplQuartz *impl = (GdkWindowImplQuartz *)private->impl;
356
374
  int i, n_rects;
357
375
  GdkRectangle *rects;
358
376
 
389
407
  gdk_region_get_rectangles (region, &rects, &n_rects);
390
408
 
391
409
  for (i = 0; i < n_rects; i++)
392
 
    {
393
 
      [impl->view setNeedsDisplayInRect:NSMakeRect (rects[i].x, rects[i].y,
394
 
                                                    rects[i].width, rects[i].height)];
395
 
    }
 
410
    _gdk_quartz_window_set_needs_display_in_rect (window, &rects[i]);
396
411
 
397
412
  g_free (rects);
398
413
 
955
970
  private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
956
971
  private->impl_window = private;
957
972
 
958
 
  /* Note: This needs to be reworked for multi-screen support. */
959
973
  impl = GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (_gdk_root)->impl);
960
 
  rect = [[NSScreen mainScreen] frame];
961
974
 
 
975
  /* The size of the root window should be the same as the size of
 
976
   * the screen it belongs to.
 
977
   *
 
978
   * FIXME: Of course this needs to be updated when you change the monitor
 
979
   * configuration (add another one, remove one, etc).
 
980
   */
962
981
  private->x = 0;
963
982
  private->y = 0;
964
983
  private->abs_x = 0;
965
984
  private->abs_y = 0;
966
 
  private->width = rect.size.width;
967
 
  private->height = rect.size.height;
 
985
  private->width = gdk_screen_get_width (_gdk_screen);
 
986
  private->height = gdk_screen_get_height (_gdk_screen);
968
987
 
969
988
  private->state = 0; /* We don't want GDK_WINDOW_STATE_WITHDRAWN here */
970
989
  private->window_type = GDK_WINDOW_ROOT;
1290
1309
              gdk_region_get_rectangles (expose_region, &rects, &n_rects);
1291
1310
 
1292
1311
              for (n = 0; n < n_rects; ++n)
1293
 
                {
1294
 
                  [impl->view setNeedsDisplayInRect:NSMakeRect (rects[n].x,
1295
 
                                                                rects[n].y,
1296
 
                                                                rects[n].width,
1297
 
                                                                rects[n].height)];
1298
 
                }
 
1312
                _gdk_quartz_window_set_needs_display_in_rect (window, &rects[n]);
1299
1313
 
1300
1314
              g_free (rects);
1301
1315
            }