gtk: Remove map and unmap event handling.
authorMatt Birkholz <puck@birchwood-abbey.net>
Wed, 18 Jan 2017 19:48:51 +0000 (12:48 -0700)
committerMatt Birkholz <puck@birchwood-abbey.net>
Wed, 18 Jan 2017 19:48:51 +0000 (12:48 -0700)
When gtk_widget_register_window (and gtk_widget_set_event) became
necessary there was no GDK_MAP_MASK nor GDK_UNMAP_MASK.  Presumably
set-fix-widget-map-handler! and set-fix-widget-unmap-handler! stopped
working at that time.  This makes it official.

src/gtk-screen/gtk-screen.pkg
src/gtk-screen/gtk-screen.scm
src/gtk/fix-layout.scm
src/gtk/gtk.pkg
src/gtk/mit-scheme-pucked-gtk.texi

index b15940e30ddae42413f3d466bc5b3ac1dbe3f3bf..8fa01ef7ea97458cda4b34b6c90065c93cd7898e 100644 (file)
@@ -159,8 +159,6 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
          fix-widget?
          fix-widget-new-geometry-callback fix-widget-realize-callback
-         set-fix-widget-map-handler!
-         set-fix-widget-unmap-handler!
          set-fix-widget-enter-notify-handler!
          set-fix-widget-leave-notify-handler!
          set-fix-widget-focus-change-handler!
index f72e7c44164eb6198829f551b1e6dd5ff295992e..c0aee12c6dfff3a1d489e6a3d46084d3d9a2b1f8 100644 (file)
@@ -704,18 +704,6 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
       (%trace ";with-gtk-interrupts-disabled => "v"\n")
       v)))
 
-(define (map-handler widget)
-  (%trace "; Mapped: "widget"\n")
-  (if (and (text-widget? widget)
-          (not (text-widget-modeline widget)))
-      (%trace ";  grab-focus "widget"\n")
-      (gtk-widget-grab-focus widget))
-  #f)
-
-(define (unmap-handler widget)
-  (%trace "; Unmapped: "widget"\n")
-  #f)
-
 (define (focus-change-handler widget in?)
   (%trace "; Focus-"(if in? "in" "out")": "widget"\n")
   (let ((screen (edwin-widget-screen widget)))
@@ -1145,8 +1133,6 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
                               (fix-rect-height extent))))
     (set-text-widget-override-drawing! widget drawing)
     (set-fix-layout-drawing! widget drawing 0 0))
-  (set-fix-widget-map-handler! widget map-handler)
-  (set-fix-widget-unmap-handler! widget unmap-handler)
   (set-fix-widget-focus-change-handler! widget focus-change-handler)
   (set-fix-widget-visibility-notify-handler! widget visibility-notify-handler)
   (set-fix-widget-key-press-handler! widget key-press-handler)
@@ -1183,6 +1169,10 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
                              (%widget-x-size window screen)
                              (%widget-y-size window screen))
          (%trace "; initialized geometry: "geometry"\n"))))
+  ;; The typein widget is undisturbed by window changes, so grab-focus
+  ;; once here.
+  (if (not (text-widget-modeline widget))
+      (gtk-widget-grab-focus widget))
   (call-next-method widget))
 
 (define-method fix-widget-new-geometry-callback ((widget <text-widget>))
@@ -1348,8 +1338,6 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
   (let ((drawing (make-fix-drawing)))
 ;;;    (%trace "; drawing: "drawing"\n")
     (set-fix-layout-drawing! widget drawing 0 0))
-  (set-fix-widget-map-handler! widget map-handler)
-  (set-fix-widget-unmap-handler! widget unmap-handler)
   (set-fix-widget-focus-change-handler! widget focus-change-handler)
   (set-fix-widget-visibility-notify-handler! widget visibility-notify-handler)
   (set-fix-widget-key-press-handler! widget key-press-handler)
index b5bae9a4a2ec71a766c7da934d884b3510381d0a..e21f6f74f1ef2f536da1cbf9719eea4eeee8162c 100644 (file)
@@ -107,8 +107,6 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
 (define event-mask
   (bit-ior
-   ;; GDK_MAP
-   ;; GDK_UNMAP
    (C-enum "GDK_ENTER_NOTIFY_MASK")
    (C-enum "GDK_LEAVE_NOTIFY_MASK")
    (C-enum "GDK_FOCUS_CHANGE_MASK")
@@ -116,10 +114,7 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
    (C-enum "GDK_KEY_PRESS_MASK")
    (C-enum "GDK_POINTER_MOTION_MASK")
    (C-enum "GDK_BUTTON_PRESS_MASK")
-   (C-enum "GDK_BUTTON_RELEASE_MASK")
-   ;; GDK_2BUTTON_PRESS
-   ;; GDK_3BUTTON_PRESS
-   ))
+   (C-enum "GDK_BUTTON_RELEASE_MASK")))
 
 (define-generic fix-widget-unrealize-callback (widget))
 
@@ -194,24 +189,6 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
       (and handler
           (handler widget GdkEvent)))))
 
-(define (set-fix-widget-map-handler! widget handler)
-  (guarantee-fix-widget widget 'set-fix-widget-map-handler!)
-  (guarantee-procedure-of-arity handler 1 'set-fix-widget-map-handler!)
-  (vector-set!
-   (fix-widget-event-handlers widget) (C-enum "GDK_MAP")
-   (named-lambda (fix-widget-map-handler widget GdkEvent)
-     (declare (ignore GdkEvent))
-     (handler widget))))
-
-(define (set-fix-widget-unmap-handler! widget handler)
-  (guarantee-fix-widget widget 'set-fix-widget-unmap-handler!)
-  (guarantee-procedure-of-arity handler 1 'set-fix-widget-unmap-handler!)
-  (vector-set!
-   (fix-widget-event-handlers widget) (C-enum "GDK_UNMAP")
-   (named-lambda (fix-widget-unmap-handler widget GdkEvent)
-     (declare (ignore GdkEvent))
-     (handler widget))))
-
 (define (set-fix-widget-enter-notify-handler! widget handler)
   (guarantee-fix-widget widget 'set-fix-widget-enter-notify-handler!)
   (guarantee-procedure-of-arity handler 1 'set-fix-widget-enter-notify-handler!)
index 1cf24f2180407ccc0de7b065777d468a63660be0..da1fa51c80fefa2ed5a4388f1c1cd2868af1ee1f 100644 (file)
@@ -189,8 +189,6 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
          fix-widget-realize-callback
          fix-widget-unrealize-callback
          set-fix-widget-pointer-shape!
-         set-fix-widget-map-handler!
-         set-fix-widget-unmap-handler!
          set-fix-widget-enter-notify-handler!
          set-fix-widget-leave-notify-handler!
          set-fix-widget-focus-change-handler!
index 53f173dfc63c78d94ca258ff238e789d57565157..bd70db94baee53498996d2ef6d147489aac60344 100644 (file)
@@ -523,14 +523,14 @@ it cannot be GCed.
 @end deffn
 
 @deffn Procedure gtk-widget-drawable? widget
-@code{#t} if @var{widget} can be drawn, i.e. it is mapped and visible.
+@code{#t} if @var{widget} can be drawn, i.e. it is realized and visible.
 @end deffn
 
 @deffn Procedure gtk-widget-grab-focus widget
 Causes @var{widget} to have the keyboard focus for the GtkWindow it's
 inside.  @var{Widget} must be a focusable widget, such as a GtkEntry;
 something like a GtkFrame will not work.  The widget also needs to be
-realized and mapped.  Grabbing the focus immediately after creating
+realized.  Grabbing the focus immediately after creating
 the widget will likely fail and cause critical warnings.
 @end deffn
 
@@ -559,7 +559,7 @@ all widgets in a container, it is easier to call
 @bref{gtk-widget-show-all} on the container.  Note that the containers
 containing @var{widget} must also be ``shown'' else @var{widget}
 cannot be displayed.  When a toplevel container is shown, it is
-immediately realized and mapped, as well as any descendents that are
+immediately realized, as well as any descendents that are
 ``showing''.
 @end deffn
 
@@ -855,7 +855,7 @@ will not resize @var{window}.
 By setting the type hint for @var{window}, you allow the window
 manager to decorate and handle the window in a way which is suitable
 to the function of the window in your application.  This function
-should be called before mapping @var{window}.  @var{Hint} can be one
+should be called before realizing @var{window}.  @var{Hint} can be one
 of the symbols in the following table.  See the Extended Window
 Manager Hints specification at
 @uref{http://www.freedesktop.org/Standards/wm-spec} for more details
@@ -1430,18 +1430,6 @@ This procedure is called when @var{widget} is resized.
 This procedure is called when @var{widget} is being realized.
 @end deffn
 
-@deffn Procedure set-fix-widget-map-handler! widget handler
-Arranges to apply @var{handler} to @var{widget} when it is mapped.
-@var{handler} must return @code{#t} or @code{#f}.
-@xref{event-handler-note}.
-@end deffn
-
-@deffn Procedure set-fix-widget-unmap-handler! widget handler
-Arranges to apply @var{handler} to @var{widget} when it is unmapped.
-@var{handler} must return @code{#t} or @code{#f}.
-@xref{event-handler-note}.
-@end deffn
-
 @deffn Procedure set-fix-widget-enter-notify-handler! widget handler
 Arranges to apply @var{handler} to @var{widget} when the pointer
 enters.