comparison src/gtk-xemacs.c @ 2195:23d90a805259

[xemacs-hg @ 2004-07-31 12:03:05 by malcolmp] Fix cases where GTK scrollbars are left in the middle of a frame.
author malcolmp
date Sat, 31 Jul 2004 12:03:05 +0000
parents 95fee4a1420e
children 04bc9d2f42c7
comparison
equal deleted inserted replaced
2194:9b40b475f33f 2195:23d90a805259
340 static void 340 static void
341 gtk_xemacs_paint (GtkWidget *widget, GdkRectangle *area) 341 gtk_xemacs_paint (GtkWidget *widget, GdkRectangle *area)
342 { 342 {
343 GtkXEmacs *x = GTK_XEMACS (widget); 343 GtkXEmacs *x = GTK_XEMACS (widget);
344 struct frame *f = GTK_XEMACS_FRAME (x); 344 struct frame *f = GTK_XEMACS_FRAME (x);
345 redisplay_redraw_exposed_area (f, area->x, area->y, area->width, 345
346 area->height); 346 if (GTK_WIDGET_DRAWABLE (widget))
347 redisplay_redraw_exposed_area (f, area->x, area->y, area->width,
348 area->height);
347 } 349 }
348 350
349 static void 351 static void
350 gtk_xemacs_draw (GtkWidget *widget, GdkRectangle *area) 352 gtk_xemacs_draw (GtkWidget *widget, GdkRectangle *area)
351 { 353 {
357 /* I need to manually iterate over the children instead of just 359 /* I need to manually iterate over the children instead of just
358 chaining to parent_class->draw() because it calls 360 chaining to parent_class->draw() because it calls
359 gtk_fixed_paint() directly, which clears the background window, 361 gtk_fixed_paint() directly, which clears the background window,
360 which causes A LOT of flashing. */ 362 which causes A LOT of flashing. */
361 363
362 gtk_xemacs_paint (widget, area); 364 if (GTK_WIDGET_DRAWABLE (widget))
363 365 {
364 children = fixed->children; 366 gtk_xemacs_paint (widget, area);
365 367
366 while (children) 368 children = fixed->children;
367 { 369
368 child = (GtkFixedChild*) children->data; 370 while (children)
369 children = children->next; 371 {
370 /* #### This is what causes the scrollbar flickering! 372 child = (GtkFixedChild*) children->data;
371 Evidently the scrollbars pretty much take care of drawing 373 children = children->next;
372 themselves in most cases. Then we come along and tell them 374 /* #### This is what causes the scrollbar flickering!
373 to redraw again! 375 Evidently the scrollbars pretty much take care of drawing
374 376 themselves in most cases. Then we come along and tell them
375 But if we just leave it out, then they do not get drawn 377 to redraw again!
376 correctly the first time! 378
377 379 But if we just leave it out, then they do not get drawn
378 Scrollbar flickering has been greatly helped by the 380 correctly the first time!
379 optimizations in scrollbar-gtk.c / 381
380 gtk_update_scrollbar_instance_status (), so this is not that 382 Scrollbar flickering has been greatly helped by the
381 big a deal anymore. 383 optimizations in scrollbar-gtk.c /
382 */ 384 gtk_update_scrollbar_instance_status (), so this is not that
383 if (gtk_widget_intersect (child->widget, area, &child_area)) 385 big a deal anymore.
384 { 386 */
385 gtk_widget_draw (child->widget, &child_area); 387 if (gtk_widget_intersect (child->widget, area, &child_area))
386 } 388 {
387 } 389 gtk_widget_draw (child->widget, &child_area);
390 }
391 }
392 }
388 } 393 }
389 394
390 static gint 395 static gint
391 gtk_xemacs_expose (GtkWidget *widget, GdkEventExpose *event) 396 gtk_xemacs_expose (GtkWidget *widget, GdkEventExpose *event)
392 { 397 {
393 GtkXEmacs *x = GTK_XEMACS (widget); 398 GtkXEmacs *x = GTK_XEMACS (widget);
394 struct frame *f = GTK_XEMACS_FRAME (x); 399 struct frame *f = GTK_XEMACS_FRAME (x);
395 GdkRectangle *a = &event->area; 400 GdkRectangle *a = &event->area;
396 401
397 /* This takes care of drawing the scrollbars, etc */ 402 if (GTK_WIDGET_DRAWABLE (widget))
398 parent_class->expose_event (widget, event); 403 {
399 404 /* This takes care of drawing the scrollbars, etc */
400 /* Now draw the actual frame data */ 405 parent_class->expose_event (widget, event);
401 if (!check_for_ignored_expose (f, a->x, a->y, a->width, a->height) && 406
402 !find_matching_subwindow (f, a->x, a->y, a->width, a->height)) 407 /* Now draw the actual frame data */
403 redisplay_redraw_exposed_area (f, a->x, a->y, a->width, a->height); 408 if (!check_for_ignored_expose (f, a->x, a->y, a->width, a->height) &&
404 return (TRUE); 409 !find_matching_subwindow (f, a->x, a->y, a->width, a->height))
410 redisplay_redraw_exposed_area (f, a->x, a->y, a->width, a->height);
411 return (TRUE);
412 }
405 } 413 }
406 414
407 Lisp_Object 415 Lisp_Object
408 xemacs_gtk_convert_color(GdkColor *c, GtkWidget *w) 416 xemacs_gtk_convert_color(GdkColor *c, GtkWidget *w)
409 { 417 {