From: Grégoire Jadi Date: Fri, 28 Jun 2013 19:18:47 +0000 (+0200) Subject: * src/xwidget.c: Fix access to w in xwidget_view (now a Lisp_Object) X-Git-Tag: emacs-25.0.90~2894^2~1 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7a76a0ab447afdba5851d1fb9e0c07db90389782;p=emacs.git * src/xwidget.c: Fix access to w in xwidget_view (now a Lisp_Object) * src/xwidget.h (xwidget_view): Convert member `w' to Lisp_Object. --- diff --git a/src/xwidget.c b/src/xwidget.c index f0f1b987005..a2ea996c56d 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -985,7 +985,7 @@ xwidget_init_view (struct xwidget *xww, }while( xv->initialized == 1); //TODO yeah this can infloop if there are MAX_WIDGETS on-screen xv->initialized = 1; - xv->w = s->w; + XSETWINDOW(xv->w, s->w); XSETXWIDGET(xv->model, xww); //widget creation @@ -1136,7 +1136,7 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) int box_line_vwidth = max (s->face->box_line_width, 0); int height = s->height; struct xwidget *xww = s->xwidget; - struct xwidget_view *xv = xwidget_view_lookup(xww, (s->w)); + struct xwidget_view *xv = xwidget_view_lookup(xww, s->w); int clip_right; int clip_bottom; int clip_top; int clip_left; int x = s->x; @@ -1525,15 +1525,11 @@ DEFUN("xwidget-delete-zombies", Fxwidget_delete_zombies , Sxwidget_delete_zombie */ struct xwidget_view* xv = NULL; - Lisp_Object w; for (int i = 0; i < MAX_XWIDGETS; i++){ xv = &xwidget_views[i]; - if (xv->w != NULL) - XSETWINDOW(w, xv->w); - if(xv->initialized && (! (WINDOW_LIVE_P(w)))){ - - gtk_widget_destroy(GTK_WIDGET(xv->widgetwindow)); - xv->initialized = 0; + if(xv->initialized && !WINDOW_LIVE_P (xv->w)) { + gtk_widget_destroy(GTK_WIDGET(xv->widgetwindow)); + xv->initialized = 0; } } } @@ -1703,7 +1699,7 @@ xwidget_view_delete_all_in_window (struct window *w) struct xwidget_view* xv = NULL; for (int i = 0; i < MAX_XWIDGETS; i++){ xv = &xwidget_views[i]; - if(xv->initialized && xv->w == w){ + if(xv->initialized && XWINDOW (xv->w) == w){ gtk_widget_destroy(GTK_WIDGET(xv->widgetwindow)); xv->initialized = 0; } @@ -1718,7 +1714,7 @@ xwidget_view_lookup (struct xwidget* xw, struct window *w) struct xwidget_view* xv = NULL; for (int i = 0; i < MAX_XWIDGETS; i++){ xv = &xwidget_views[i]; - if (xv->initialized && (XXWIDGET (xv->model) == xw) && (xv->w == w)) + if (xv->initialized && (XXWIDGET (xv->model) == xw) && (XWINDOW (xv->w) == w)) return xv; } return NULL; /* we didnt find a matching view */ @@ -1835,7 +1831,7 @@ xwidget_end_redisplay (struct window *w, struct glyph_matrix *matrix) struct xwidget_view* xv = &xwidget_views[i]; //"touched" is only meaningful for the current window, so disregard other views - if (xv->initialized && ( xv->w == w)) + if (xv->initialized && (XWINDOW (xv->w) == w)) { if (xwidget_touched(xv)) xwidget_show_view (xv); diff --git a/src/xwidget.h b/src/xwidget.h index 81a5deacca3..c1ff13ee396 100644 --- a/src/xwidget.h +++ b/src/xwidget.h @@ -46,15 +46,12 @@ struct xwidget{ struct xwidget_view { struct vectorlike_header header; Lisp_Object model; - + Lisp_Object w; //here ends the lisp part. //"redisplayed" is the marker field int redisplayed; //if touched by redisplay - - struct window *w; //TODO should be lisp - int hidden;//if the "live" instance isnt drawn int initialized;