]> code.delx.au - gnu-emacs/blobdiff - src/dispnew.c
auto upstream
[gnu-emacs] / src / dispnew.c
index 675c06c22e920a46eda98e705f8bbd1ce83d0685..27a5d2ae11342c626ace1573f4827bb4c9dfdbcb 100644 (file)
@@ -16,7 +16,6 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
-
 #include <config.h>
 
 #define DISPEXTERN_INLINE EXTERN_INLINE
@@ -48,6 +47,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include TERM_HEADER
 #endif /* HAVE_WINDOW_SYSTEM */
 
+#ifdef HAVE_XWIDGETS
+#include "xwidget.h"
+#endif
+
 /* Include systime.h after xterm.h to avoid double inclusion of time.h.  */
 
 #include "systime.h"
@@ -242,8 +245,7 @@ add_window_display_history (struct window *w, const char *msg, bool paused_p)
    PAUSED_P means that the update has been interrupted for
    pending input.  */
 
-static void
-add_frame_display_history (struct frame *f, bool paused_p)
+static void add_frame_display_history (struct frame *f, int paused_p)
 {
   char *buf;
 
@@ -3593,6 +3595,9 @@ update_window (struct window *w, bool force_p)
   add_window_display_history (w, w->current_matrix->method, paused_p);
 #endif
 
+#ifdef HAVE_XWIDGETS
+  xwidget_end_redisplay(w, w->current_matrix);
+#endif
   clear_glyph_matrix (desired_matrix);
 
   return paused_p;
@@ -4016,11 +4021,10 @@ set_window_cursor_after_update (struct window *w)
       vpos = w->cursor.vpos;
     }
 
-  /* Window cursor can be out of sync for horizontally split windows.  */
-  hpos = max (-1, hpos); /* -1 is for when cursor is on the left fringe */
-  hpos = min (w->current_matrix->matrix_w - 1, hpos);
-  vpos = max (0, vpos);
-  vpos = min (w->current_matrix->nrows - 1, vpos);
+  /* Window cursor can be out of sync for horizontally split windows.
+     Horizontal position is -1 when cursor is on the left fringe.   */
+  hpos = clip_to_bounds (-1, hpos, w->current_matrix->matrix_w - 1);
+  vpos = clip_to_bounds (0, vpos, w->current_matrix->nrows - 1);
   rif->cursor_to (vpos, hpos, cy, cx);
 }
 
@@ -4191,6 +4195,12 @@ scrolling_window (struct window *w, bool header_line_p)
        break;
     }
 
+#ifdef HAVE_XWIDGETS
+ //currently this is needed to detect xwidget movement reliably. or probably not.
+  //printf("scrolling_window\n");
+    return 0;
+#endif
+  
   /* Give up if some rows in the desired matrix are not enabled.  */
   if (!MATRIX_ROW (desired_matrix, i)->enabled_p)
     return -1;