diff options
| author | Joakim Verona | 2011-06-23 08:41:08 +0200 |
|---|---|---|
| committer | Joakim Verona | 2011-06-23 08:41:08 +0200 |
| commit | 6716c046071a641da713adf2e1e3d2f583643a9d (patch) | |
| tree | 7d8f4dccb5aba043dd538fd5dc703bcfe00fc681 /src | |
| parent | c5082a753011dacef505e91f1fc30a84fa75a2eb (diff) | |
| download | emacs-6716c046071a641da713adf2e1e3d2f583643a9d.tar.gz emacs-6716c046071a641da713adf2e1e3d2f583643a9d.zip | |
clipping works again
Diffstat (limited to 'src')
| -rw-r--r-- | src/xwidget.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/xwidget.c b/src/xwidget.c index 5ebecd63937..f2d06ae1792 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -246,8 +246,11 @@ xwidget_init_view ( | |||
| 246 | xv->emacswindow = GTK_CONTAINER (s->f->gwfixed); | 246 | xv->emacswindow = GTK_CONTAINER (s->f->gwfixed); |
| 247 | //xw->widgetwindow = GTK_CONTAINER (gtk_layout_new (NULL, NULL)); | 247 | //xw->widgetwindow = GTK_CONTAINER (gtk_layout_new (NULL, NULL)); |
| 248 | //xw->widgetwindow = GTK_CONTAINER (gtk_offscreen_window_new ()); | 248 | //xw->widgetwindow = GTK_CONTAINER (gtk_offscreen_window_new ()); |
| 249 | xv->widgetwindow = GTK_CONTAINER (gtk_fixed_new ()); | 249 | |
| 250 | //xw->widgetwindow = GTK_CONTAINER (gtk_event_box_new ()); | 250 | xv->widgetwindow = GTK_CONTAINER (gtk_fixed_new ()); |
| 251 | gtk_widget_set_has_window( xv->widgetwindow, TRUE); //if gtk_fixed doesnt have a window it will surprisingly not honor setsize so that children gets clipped later. the documentation is not consistent regarding if its legal to call this method | ||
| 252 | //xv->widgetwindow = GTK_CONTAINER (gtk_event_box_new ()); | ||
| 253 | |||
| 251 | //gtk_widget_set_size_request (GTK_WIDGET (xw->widget), xw->width, xw->height); | 254 | //gtk_widget_set_size_request (GTK_WIDGET (xw->widget), xw->width, xw->height); |
| 252 | //gtk_layout_set_size (GTK_LAYOUT (xw->widgetwindow), xw->width, xw->height); | 255 | //gtk_layout_set_size (GTK_LAYOUT (xw->widgetwindow), xw->width, xw->height); |
| 253 | gtk_container_add (xv->widgetwindow, xv->widget); | 256 | gtk_container_add (xv->widgetwindow, xv->widget); |
| @@ -373,15 +376,17 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) | |||
| 373 | //clip the widget window if some parts happen to be outside drawable area | 376 | //clip the widget window if some parts happen to be outside drawable area |
| 374 | //an emacs window is not a gtk window, a gtk window covers the entire frame | 377 | //an emacs window is not a gtk window, a gtk window covers the entire frame |
| 375 | //cliping might have changed even if we havent actualy moved, we try figure out when we need to reclip for real | 378 | //cliping might have changed even if we havent actualy moved, we try figure out when we need to reclip for real |
| 376 | if((xv->clipx != clipx) || (xv->clipy != clipy)) | 379 | if((xv->clipx != clipx) || (xv->clipy != clipy)){ |
| 377 | gtk_widget_set_size_request (GTK_WIDGET (xv->widgetwindow), | 380 | gtk_widget_set_size_request (GTK_WIDGET (xv->widgetwindow), |
| 378 | clipx, clipy); | 381 | clipx, clipy); |
| 379 | xv->clipx = clipx; xv->clipy = clipy; | 382 | printf("reclip %d %d -> %d %d\n",xv->clipx, xv->clipy, clipx, clipy ); |
| 383 | xv->clipx = clipx; xv->clipy = clipy; | ||
| 384 | } | ||
| 380 | //a live xwidget paints itself. when using composition, that | 385 | //a live xwidget paints itself. when using composition, that |
| 381 | //happens through the expose handler for the xwidget | 386 | //happens through the expose handler for the xwidget |
| 382 | //if emacs wants to repaint the area where the widget lives, queue a redraw | 387 | //if emacs wants to repaint the area where the widget lives, queue a redraw |
| 383 | if (!xwidget_hidden(xv)) | 388 | //if (!xwidget_hidden(xv)) |
| 384 | gtk_widget_queue_draw (xv->widget); | 389 | //gtk_widget_queue_draw (xv->widget); |
| 385 | } | 390 | } |
| 386 | else | 391 | else |
| 387 | { | 392 | { |