diff options
| author | Joakim Verona | 2010-09-16 15:36:31 +0200 |
|---|---|---|
| committer | Joakim Verona | 2010-09-16 15:36:31 +0200 |
| commit | 07b89477b22b5c2343009c62a7cfaa3006e45d57 (patch) | |
| tree | b659d3e9045313584ed4581edb0df9230a65cc8b /src/xwidget.c | |
| parent | bb8b8baa75c4161e2c20d517433e0f2a5a06de54 (diff) | |
| download | emacs-07b89477b22b5c2343009c62a7cfaa3006e45d57.tar.gz emacs-07b89477b22b5c2343009c62a7cfaa3006e45d57.zip | |
still doesnt actually work. cleaned up a bit. this version seems to redraw so much it gets sluggish. clipping works worse than previously still
Diffstat (limited to 'src/xwidget.c')
| -rw-r--r-- | src/xwidget.c | 47 |
1 files changed, 16 insertions, 31 deletions
diff --git a/src/xwidget.c b/src/xwidget.c index e4f1cedad60..98b861ca401 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -489,47 +489,32 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) | |||
| 489 | { | 489 | { |
| 490 | if ((xw->x != x) || (xw->y != y)) //has it moved? | 490 | if ((xw->x != x) || (xw->y != y)) //has it moved? |
| 491 | { | 491 | { |
| 492 | printf ("xwidget moved: id:%d (%d,%d)->(%d,%d)\n", xw->id, xw->x, xw->y, x, y); | 492 | printf ("live xwidget moved: id:%d (%d,%d)->(%d,%d)\n", xw->id, xw->x, xw->y, x, y); |
| 493 | } | 493 | if (!xwidget_hidden(xw)) //hidden equals not being seen in the live window |
| 494 | else | 494 | { |
| 495 | { | 495 | gtk_fixed_move (GTK_FIXED (s->f->gwfixed), |
| 496 | } | 496 | GTK_WIDGET (xw->widgetwindow), x, y); |
| 497 | //TODO maybe theres a bug that the hidden flag sometimes dont get reset properly | 497 | //clip the widget window if some parts happen to be outside drawable area |
| 498 | if (!xwidget_hidden(xw)) //hidden equals not being seen in the live window | 498 | //an emacs window is not a gtk window, a gtk window covers the entire frame |
| 499 | { | 499 | gtk_widget_set_size_request (GTK_WIDGET (xw->widgetwindow), |
| 500 | gtk_fixed_move (GTK_FIXED (s->f->gwfixed), | 500 | clipx, clipy); |
| 501 | GTK_WIDGET (xw->widgetwindow), x, y); | 501 | } |
| 502 | //clip the widget window if some parts happen to be outside drawable area | ||
| 503 | //an emacs window is not a gtk window, a gtk window covers the entire frame | ||
| 504 | gtk_widget_set_size_request (GTK_WIDGET (xw->widgetwindow), | ||
| 505 | clipx, clipy); | ||
| 506 | |||
| 507 | //if we are using compositing, we are always responsible for drawing the widget on the screen | ||
| 508 | //just reuse the phantom routine for now | ||
| 509 | //printf("draw live xwidget at:%d %d\n",x,y); | ||
| 510 | //xwidget_draw_phantom (xw, x, y, clipx, clipy, s, 1); | ||
| 511 | } | ||
| 512 | else | ||
| 513 | { | ||
| 514 | //xwidget is hidden, hide it offscreen somewhere, still realized, so we may snapshot it | ||
| 515 | //gtk_fixed_move(GTK_FIXED(s->f->gwfixed),GTK_WIDGET(xw->widgetwindow) ,10000,10000); | ||
| 516 | //gtk_widget_hide(GTK_WIDGET(xw->widgetwindow)); | ||
| 517 | } | 502 | } |
| 518 | //xw refers to the *live* instance of the xwidget | 503 | //a live xwidget paints itself. when using composition, that |
| 504 | //happens through the expose handler for the xwidget | ||
| 505 | if (!xwidget_hidden(xw)) | ||
| 506 | gtk_widget_queue_draw (xw->widget); | ||
| 507 | //xw refers to the *live* instance of the xwidget, so only | ||
| 508 | //update coords when drawing in the selected window | ||
| 519 | xw->x = x; | 509 | xw->x = x; |
| 520 | xw->y = y; | 510 | xw->y = y; |
| 521 | |||
| 522 | |||
| 523 | } | 511 | } |
| 524 | else | 512 | else |
| 525 | { | 513 | { |
| 526 | //ok, we are painting the xwidgets in non-selected window, so draw a phantom | 514 | //ok, we are painting the xwidgets in non-selected window, so draw a phantom |
| 527 | //printf("draw phantom xwidget at:%d %d\n",x,y); | 515 | //printf("draw phantom xwidget at:%d %d\n",x,y); |
| 528 | |||
| 529 | xwidget_draw_phantom (xw, x, y, clipx, clipy, s, 1); | 516 | xwidget_draw_phantom (xw, x, y, clipx, clipy, s, 1); |
| 530 | |||
| 531 | } | 517 | } |
| 532 | |||
| 533 | } | 518 | } |
| 534 | 519 | ||
| 535 | 520 | ||