diff options
| author | Joakim Verona | 2011-08-08 17:06:52 +0200 |
|---|---|---|
| committer | Joakim Verona | 2011-08-08 17:06:52 +0200 |
| commit | 23e9910c1fc51657f08b4ab125c0c44e5860d942 (patch) | |
| tree | 3bdd8c587e19f029e94591ef1a63ff02a4a20311 /src | |
| parent | c5e10d038d040a7bb0eedb64469705ff84addd09 (diff) | |
| download | emacs-23e9910c1fc51657f08b4ab125c0c44e5860d942.tar.gz emacs-23e9910c1fc51657f08b4ab125c0c44e5860d942.zip | |
GLYPH_DEBUG fix
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispnew.c | 5 | ||||
| -rw-r--r-- | src/emacsgtkfixed.c | 4 | ||||
| -rw-r--r-- | src/xdisp.c | 19 | ||||
| -rw-r--r-- | src/xwidget.c | 11 | ||||
| -rw-r--r-- | src/xwidget.h | 4 |
5 files changed, 33 insertions, 10 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index d4da4297529..b4d2dc2334a 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -280,15 +280,14 @@ add_window_display_history (struct window *w, const char *msg, int paused_p) | |||
| 280 | : "???"), | 280 | : "???"), |
| 281 | paused_p ? " ***paused***" : ""); | 281 | paused_p ? " ***paused***" : ""); |
| 282 | strcat (buf, msg); | 282 | strcat (buf, msg); |
| 283 | 283 | } | |
| 284 | 284 | ||
| 285 | 285 | ||
| 286 | /* Add to the redisplay history that frame F has been displayed. | 286 | /* Add to the redisplay history that frame F has been displayed. |
| 287 | PAUSED_P non-zero means that the update has been interrupted for | 287 | PAUSED_P non-zero means that the update has been interrupted for |
| 288 | pending input. */ | 288 | pending input. */ |
| 289 | 289 | ||
| 290 | static void | 290 | static void add_frame_display_history (struct frame *f, int paused_p) |
| 291 | add_frame_display_history (struct frame *f, int paused_p) | ||
| 292 | { | 291 | { |
| 293 | char *buf; | 292 | char *buf; |
| 294 | 293 | ||
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c index 34daab7285f..7f8d8939d42 100644 --- a/src/emacsgtkfixed.c +++ b/src/emacsgtkfixed.c | |||
| @@ -80,7 +80,7 @@ static void emacs_fixed_gtk_widget_size_allocate (GtkWidget *widget, | |||
| 80 | GtkWidgetClass *parent_class; | 80 | GtkWidgetClass *parent_class; |
| 81 | struct GtkFixedPrivateL* priv; | 81 | struct GtkFixedPrivateL* priv; |
| 82 | 82 | ||
| 83 | printf(" emacs_fixed_gtk_widget_size_allocate\n"); | 83 | // printf(" emacs_fixed_gtk_widget_size_allocate\n"); |
| 84 | klass = EMACS_FIXED_GET_CLASS (widget); | 84 | klass = EMACS_FIXED_GET_CLASS (widget); |
| 85 | parent_class = g_type_class_peek_parent (klass); | 85 | parent_class = g_type_class_peek_parent (klass); |
| 86 | parent_class->size_allocate (widget, allocation); | 86 | parent_class->size_allocate (widget, allocation); |
| @@ -148,7 +148,7 @@ static void emacs_fixed_gtk_widget_size_allocate (GtkWidget *widget, | |||
| 148 | child_allocation.height = xv->clip_bottom - xv->clip_top; | 148 | child_allocation.height = xv->clip_bottom - xv->clip_top; |
| 149 | //gtk_widget_size_allocate (child, &child_allocation); | 149 | //gtk_widget_size_allocate (child, &child_allocation); |
| 150 | //TODO find a way to remove this feeble workaround | 150 | //TODO find a way to remove this feeble workaround |
| 151 | printf(" allocation internal modification for xw %d %d,%d\n",xv, child_allocation.width, child_allocation.height); | 151 | // printf(" allocation internal modification for xw %d %d,%d\n",xv, child_allocation.width, child_allocation.height); |
| 152 | 152 | ||
| 153 | } | 153 | } |
| 154 | gtk_widget_size_allocate (child->widget, &child_allocation); | 154 | gtk_widget_size_allocate (child->widget, &child_allocation); |
diff --git a/src/xdisp.c b/src/xdisp.c index f01b277d35c..de9c624ba04 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -6842,7 +6842,7 @@ set_iterator_to_next (struct it *it, int reseat_p) | |||
| 6842 | case GET_FROM_STRETCH: | 6842 | case GET_FROM_STRETCH: |
| 6843 | #ifdef HAVE_XWIDGETS | 6843 | #ifdef HAVE_XWIDGETS |
| 6844 | case GET_FROM_XWIDGET: | 6844 | case GET_FROM_XWIDGET: |
| 6845 | #endif | 6845 | |
| 6846 | /* The position etc with which we have to proceed are on | 6846 | /* The position etc with which we have to proceed are on |
| 6847 | the stack. The position may be at the end of a string, | 6847 | the stack. The position may be at the end of a string, |
| 6848 | if the `display' property takes up the whole string. */ | 6848 | if the `display' property takes up the whole string. */ |
| @@ -6851,7 +6851,7 @@ set_iterator_to_next (struct it *it, int reseat_p) | |||
| 6851 | if (it->method == GET_FROM_STRING) | 6851 | if (it->method == GET_FROM_STRING) |
| 6852 | goto consider_string_end; | 6852 | goto consider_string_end; |
| 6853 | break; | 6853 | break; |
| 6854 | 6854 | #endif | |
| 6855 | default: | 6855 | default: |
| 6856 | /* There are no other methods defined, so this should be a bug. */ | 6856 | /* There are no other methods defined, so this should be a bug. */ |
| 6857 | abort (); | 6857 | abort (); |
| @@ -12733,6 +12733,13 @@ redisplay_internal (void) | |||
| 12733 | *w->desired_matrix->method = 0; | 12733 | *w->desired_matrix->method = 0; |
| 12734 | debug_method_add (w, "optimization 1"); | 12734 | debug_method_add (w, "optimization 1"); |
| 12735 | #endif | 12735 | #endif |
| 12736 | #if HAVE_XWIDGETS | ||
| 12737 | //debug optimization movement issue | ||
| 12738 | w->desired_matrix->no_scrolling_p = 1; | ||
| 12739 | //*w->desired_matrix->method = 0; | ||
| 12740 | //debug_method_add (w, "optimization 1"); | ||
| 12741 | #endif | ||
| 12742 | |||
| 12736 | #ifdef HAVE_WINDOW_SYSTEM | 12743 | #ifdef HAVE_WINDOW_SYSTEM |
| 12737 | update_window_fringes (w, 0); | 12744 | update_window_fringes (w, 0); |
| 12738 | #endif | 12745 | #endif |
| @@ -15661,6 +15668,12 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 15661 | return 0; | 15668 | return 0; |
| 15662 | #endif | 15669 | #endif |
| 15663 | 15670 | ||
| 15671 | #if HAVE_XWIDGETS | ||
| 15672 | //currently this is needed to detect xwidget movement reliably. or probably not. | ||
| 15673 | return 0; | ||
| 15674 | #endif | ||
| 15675 | |||
| 15676 | |||
| 15664 | if (/* This function doesn't handle terminal frames. */ | 15677 | if (/* This function doesn't handle terminal frames. */ |
| 15665 | !FRAME_WINDOW_P (f) | 15678 | !FRAME_WINDOW_P (f) |
| 15666 | /* Don't try to reuse the display if windows have been split | 15679 | /* Don't try to reuse the display if windows have been split |
| @@ -24626,7 +24639,7 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width, | |||
| 24626 | 24639 | ||
| 24627 | #ifdef HAVE_XWIDGETS | 24640 | #ifdef HAVE_XWIDGETS |
| 24628 | if (glyph != NULL && glyph->type == XWIDGET_GLYPH){ | 24641 | if (glyph != NULL && glyph->type == XWIDGET_GLYPH){ |
| 24629 | printf("attempt xwidget cursor avoidance in get_window_cursor_type\n"); | 24642 | //printf("attempt xwidget cursor avoidance in get_window_cursor_type\n"); |
| 24630 | return NO_CURSOR; | 24643 | return NO_CURSOR; |
| 24631 | } | 24644 | } |
| 24632 | #endif | 24645 | #endif |
diff --git a/src/xwidget.c b/src/xwidget.c index a25dd170731..1c68e919efa 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -631,15 +631,20 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) | |||
| 631 | clip_top = max(0, WINDOW_TOP_EDGE_Y(s->w) -y ); | 631 | clip_top = max(0, WINDOW_TOP_EDGE_Y(s->w) -y ); |
| 632 | 632 | ||
| 633 | //we are conserned with movement of the onscreen area. the area might sit still when the widget actually moves | 633 | //we are conserned with movement of the onscreen area. the area might sit still when the widget actually moves |
| 634 | //this happens when an emacs window border moves across a widget winow | 634 | //this happens when an emacs window border moves across a widget window |
| 635 | //so, if any corner of the outer widget clippng window moves, that counts as movement here, even | ||
| 636 | //if it looks like no movement happens because the widget sits still inside the clipping area. | ||
| 637 | //the widget can also move inside the clipping area, which happens later | ||
| 635 | moved = (xv->x + xv->clip_left != x+clip_left) | 638 | moved = (xv->x + xv->clip_left != x+clip_left) |
| 636 | || ((xv->y + xv->clip_top)!= (y+clip_top)); | 639 | || ((xv->y + xv->clip_top)!= (y+clip_top)); |
| 637 | if(moved) printf ("lxwidget moved: id:%d (%d,%d)->(%d,%d) y+clip_top:%d\n", xww, xv->x, xv->y, x, y, y + clip_top); | 640 | if(moved) printf ("lxwidget moved: id:%d (%d,%d)->(%d,%d) y+clip_top:%d\n", xww, xv->x, xv->y, x, y, y + clip_top); |
| 641 | else | ||
| 642 | printf ("lxwidget DIDNT move: id:%d (%d,%d)->(%d,%d) y+clip_top:%d\n", xww, xv->x, xv->y, x, y, y + clip_top); | ||
| 638 | xv->x = x; | 643 | xv->x = x; |
| 639 | xv->y = y; | 644 | xv->y = y; |
| 640 | if (moved) //has it moved? | 645 | if (moved) //has it moved? |
| 641 | { | 646 | { |
| 642 | if (!xwidget_hidden(xv)) //hidden equals not being seen during redisplay | 647 | if (1)//!xwidget_hidden(xv)) //hidden equals not being seen during redisplay |
| 643 | { | 648 | { |
| 644 | //TODO should be possible to use xwidget_show_view here | 649 | //TODO should be possible to use xwidget_show_view here |
| 645 | gtk_fixed_move (GTK_FIXED (FRAME_GTK_WIDGET (s->f)), | 650 | gtk_fixed_move (GTK_FIXED (FRAME_GTK_WIDGET (s->f)), |
| @@ -662,6 +667,8 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) | |||
| 662 | xv->clip_right = clip_right; xv->clip_bottom = clip_bottom; xv->clip_top = clip_top;xv->clip_left = clip_left; | 667 | xv->clip_right = clip_right; xv->clip_bottom = clip_bottom; xv->clip_top = clip_top;xv->clip_left = clip_left; |
| 663 | } | 668 | } |
| 664 | //if emacs wants to repaint the area where the widget lives, queue a redraw | 669 | //if emacs wants to repaint the area where the widget lives, queue a redraw |
| 670 | //TODO it seems its possible to get out of sync with emacs redraws so emacs bg sometimes shows up instead of xwidget | ||
| 671 | //its just a visual glitch though | ||
| 665 | if (!xwidget_hidden(xv)){ | 672 | if (!xwidget_hidden(xv)){ |
| 666 | gtk_widget_queue_draw (GTK_WIDGET(xv->widgetwindow)); | 673 | gtk_widget_queue_draw (GTK_WIDGET(xv->widgetwindow)); |
| 667 | gtk_widget_queue_draw (xv->widget); | 674 | gtk_widget_queue_draw (xv->widget); |
diff --git a/src/xwidget.h b/src/xwidget.h index c515980ef12..e5cfe6de902 100644 --- a/src/xwidget.h +++ b/src/xwidget.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #ifndef XWIDGET_H_INCLUDED | ||
| 2 | #define XWIDGET_H_INCLUDED | ||
| 3 | |||
| 1 | void x_draw_xwidget_glyph_string (struct glyph_string *s); | 4 | void x_draw_xwidget_glyph_string (struct glyph_string *s); |
| 2 | void syms_of_xwidget (); | 5 | void syms_of_xwidget (); |
| 3 | 6 | ||
| @@ -104,3 +107,4 @@ struct xwidget* lookup_xwidget (Lisp_Object spec); | |||
| 104 | #define XG_XWIDGET "emacs_xwidget" | 107 | #define XG_XWIDGET "emacs_xwidget" |
| 105 | #define XG_XWIDGET_VIEW "emacs_xwidget_view" | 108 | #define XG_XWIDGET_VIEW "emacs_xwidget_view" |
| 106 | void xwidget_view_delete_all_in_window( struct window *w ); | 109 | void xwidget_view_delete_all_in_window( struct window *w ); |
| 110 | #endif | ||