diff src/glyphs-x.c @ 863:42375619fa45

[xemacs-hg @ 2002-06-04 06:03:59 by andyp] merge 21.4 windows changes, minimally tested
author andyp
date Tue, 04 Jun 2002 06:05:53 +0000
parents 2b6fa2618f76
children 804517e16990
line wrap: on
line diff
--- a/src/glyphs-x.c	Mon Jun 03 12:24:14 2002 +0000
+++ b/src/glyphs-x.c	Tue Jun 04 06:05:53 2002 +0000
@@ -4,7 +4,7 @@
    Copyright (C) 1995 Tinker Systems
    Copyright (C) 1995, 1996, 2001, 2002 Ben Wing
    Copyright (C) 1995 Sun Microsystems
-   Copyright (C) 1999, 2000 Andy Piper
+   Copyright (C) 1999, 2000, 2002 Andy Piper
 
 This file is part of XEmacs.
 
@@ -150,6 +150,8 @@
 #endif
 void
 emacs_Xt_handle_widget_losing_focus (struct frame* f, Widget losing_widget);
+void
+enqueue_focus_event (Widget wants_it, Lisp_Object frame, int in_p);
 
 #include "bitmaps.h"
 
@@ -2064,6 +2066,14 @@
 		    -dga->xoffset, -dga->yoffset);
       if (!IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (p))
 	XtMapWidget (IMAGE_INSTANCE_X_CLIPWIDGET (p));
+      /* See comments in glyphs-msw.c about keyboard focus. */
+      if (IMAGE_INSTANCE_WANTS_INITIAL_FOCUS (p)) {
+	/* #### FIXME to pop-up the find dialog we map the text-field
+	   seven times! This doesn't show on a fast linux box but does
+	   under X on windows. */
+	enqueue_focus_event (IMAGE_INSTANCE_X_WIDGET_ID (p),
+			     IMAGE_INSTANCE_FRAME (p), 1);
+      }
     }
 }
 
@@ -2237,6 +2247,14 @@
   IMAGE_INSTANCE_SUBWINDOW_ID (ii) = (void*)win;
 }
 
+/* Account for some of the limitations with widget images. */
+static int
+x_widget_border_width (void)
+{
+  return DEFAULT_WIDGET_BORDER_WIDTH * 2;
+}
+
+
 #if 0
 /* #### Should this function exist? If there's any doubt I'm not implementing it --andyp */
 DEFUN ("change-subwindow-property", Fchange_subwindow_property, 3, 3, 0, /*
@@ -2401,6 +2419,10 @@
 
   free_widget_value_tree (clip_wv);
 
+  /* create a sensible name. */
+  if (wv->name == 0 || strcmp(wv->name, "") == 0)
+    wv->name = xstrdup (type);
+
   /* copy any args we were given */
   ac = 0;
   lw_add_value_args_to_args (wv, al, &ac);
@@ -2772,6 +2794,7 @@
   CONSOLE_HAS_METHOD (x, map_subwindow);
   CONSOLE_HAS_METHOD (x, redisplay_widget);
   CONSOLE_HAS_METHOD (x, redisplay_subwindow);
+  CONSOLE_HAS_METHOD (x, widget_border_width);
 }
 
 void