From ihatchondo at common-lisp.net Fri May 4 08:26:15 2007 From: ihatchondo at common-lisp.net (ihatchondo) Date: Fri, 4 May 2007 04:26:15 -0400 (EDT) Subject: [Eclipse-cvs] CVS eclipse Message-ID: <20070504082615.209F821057@common-lisp.net> Update of /project/eclipse/cvsroot/eclipse In directory clnet:/tmp/cvs-serv20990 Modified Files: input.lisp misc.lisp widgets.lisp wm.lisp Log Message: Fix: - _net_wm_state_maximized were improperly handled when an application is newly decorated. - recomputation of the application geometry before maximization when the wm-size-hints property is changed. - handling of the _net_wm_state_maximized in configure-window (misc.lisp) - _net_wm__state property update before put an application in fullscreen to avoid race conditions. (widgets.lisp) --- /project/eclipse/cvsroot/eclipse/input.lisp 2005/03/01 22:41:31 1.44 +++ /project/eclipse/cvsroot/eclipse/input.lisp 2007/05/04 08:26:14 1.45 @@ -1,5 +1,5 @@ ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*- -;;; $Id: input.lisp,v 1.44 2005/03/01 22:41:31 ihatchondo Exp $ +;;; $Id: input.lisp,v 1.45 2007/05/04 08:26:14 ihatchondo Exp $ ;;; ;;; ECLIPSE. The Common Lisp Window Manager. ;;; Copyright (C) 2000, 2001, 2002 Iban HATCHONDO @@ -25,7 +25,7 @@ (deftype client-message-data () `(simple-array (or xlib:card8 xlib:card16 xlib:card32) (*))) -;; Most generals methods. +;; Most general methods. (defmethod event-process ((event mapping-notify) null-widget) (declare (ignorable null-widget)) @@ -211,10 +211,8 @@ (defmethod event-process :after ((event button-release) (root root)) (with-slots (move-status resize-status current-active-widget) root (when (or move-status resize-status) - (xlib:ungrab-server *display*) - (xlib:ungrab-pointer *display*) (setf (slot-value current-active-widget 'active-p) nil) - (setf (values current-active-widget move-status resize-status) nil)))) + (dismiss-move-resize root)))) ;;; Events for master (type: decoration) @@ -293,14 +291,28 @@ :_net_active_window)))) (defmethod event-process ((event property-notify) (app application)) - (with-slots (window master type transient-for) app + (with-slots (window master type transient-for initial-geometry) app (case (event-atom event) (:wm_normal_hints + ;; recompute decoration wm-size-hints and initial-geometry. (when master - (with-slots (hmargin vmargin) (decoration-frame-style master) - (with-slots (application-gravity wm-size-hints) master - (multiple-value-setq (wm-size-hints application-gravity) - (recompute-wm-normal-hints window hmargin vmargin)))))) + (with-slots (hmargin vmargin) (decoration-frame-style master) + (let ((old-wmsh (decoration-wm-size-hints master))) + (with-slots (application-gravity (wmsh wm-size-hints)) master + (multiple-value-setq (wmsh application-gravity) + (recompute-wm-normal-hints window hmargin vmargin)) + ;; wm-size-hints: '#(minw minh maxw maxh incw inch basew baseh). + (symbol-macrolet ((minw (aref wmsh 0)) (minh (aref wmsh 1)) + (maxw (aref wmsh 2)) (maxh (aref wmsh 3)) + (incw (aref wmsh 4)) (inch (aref wmsh 5)) + (basew (aref wmsh 6)) (baseh (aref wmsh 7))) + (multiple-value-bind (w h) (geometry-sizes initial-geometry) + (let ((rw (/ (- w (aref old-wmsh 6)) (aref old-wmsh 4))) + (rh (/ (- h (aref old-wmsh 7)) (aref old-wmsh 5)))) + (setf (geometry-w initial-geometry) + (max (min (+ (* rw incw) basew) maxw) minw)) + (setf (geometry-h initial-geometry) + (max (min (+ (* rh inch) baseh) maxh) minh)))))))))) ((:wm_name :_net_wm_name) (when (and master (get-child master :title-bar)) (with-slots (window item-to-draw) (get-child master :title-bar) @@ -390,12 +402,12 @@ (iconic-p (uniconify icon))) (with-slots ((pwindow window)) (root-property-holder *root*) (let* ((length (length data)) - (source (if (> length 0) (aref data 0) 0)) (time (if (> length 1) (aref data 1) 0)) (wtime (or (netwm:net-wm-user-time pwindow) 0))) - (unless (or (= source 1) (> wtime time 0)) + (unless (> wtime time 0) (setf (netwm:net-wm-user-time pwindow) time) - (focus-widget application time))))) + (focus-widget application time) + (put-on-top application))))) (:_net_wm_desktop (migrate-application application (aref data 0))) (:_net_close_window (close-widget application)))))) --- /project/eclipse/cvsroot/eclipse/misc.lisp 2006/01/21 19:15:57 1.35 +++ /project/eclipse/cvsroot/eclipse/misc.lisp 2007/05/04 08:26:14 1.36 @@ -1,5 +1,5 @@ ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*- -;;; $Id: misc.lisp,v 1.35 2006/01/21 19:15:57 ihatchondo Exp $ +;;; $Id: misc.lisp,v 1.36 2007/05/04 08:26:14 ihatchondo Exp $ ;;; ;;; This file is part of Eclipse. ;;; Copyright (C) 2002 Iban HATCHONDO @@ -331,6 +331,16 @@ ;; update sizes. (when (or width height) (with-event-mask ((or parent win)) + (when application + ;; ensure width or height are compatible with wm-size-hints. + (multiple-value-bind (w h) + (geometry-sizes (find-max-geometry application 1 nil)) + (let* ((prop (netwm:net-wm-state win)) + (horz-p (member :_net_wm_state_maximized_horz prop)) + (vert-p (member :_net_wm_state_maximized_vert prop))) + (unless (member :_net_wm_state_fullscreen prop) + (when width (setf width (if horz-p w (min width w)))) + (when height (setf height (if vert-p h (min height h)))))))) (xlib:with-state (win) (when width (setf (xlib:drawable-width win) width)) (when height (setf (xlib:drawable-height win) height))) --- /project/eclipse/cvsroot/eclipse/widgets.lisp 2005/03/01 22:41:31 1.46 +++ /project/eclipse/cvsroot/eclipse/widgets.lisp 2007/05/04 08:26:14 1.47 @@ -1,5 +1,5 @@ ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*- -;;; $Id: widgets.lisp,v 1.46 2005/03/01 22:41:31 ihatchondo Exp $ +;;; $Id: widgets.lisp,v 1.47 2007/05/04 08:26:14 ihatchondo Exp $ ;;; ;;; ECLIPSE. The Common Lisp Window Manager. ;;; Copyright (C) 2000, 2001, 2002 Iban HATCHONDO @@ -370,6 +370,12 @@ (defsetf fullscreen-mode (application) (mode) "Mode may be (or :on :off). Put or remove application in or from fullscreen." `(with-slots (window (fgeometry full-geometry) master icon) ,application + ;; reset appropriately _net_wm_state property. + (let ((prop (netwm:net-wm-state window))) + (if (eq ,mode :on) + (pushnew :_net_wm_state_fullscreen prop) + (setf prop (delete :_net_wm_state_fullscreen prop))) + (setf (netwm:net-wm-state window) prop)) (if (eq ,mode :on) ;; put in fullscreen mode. (with-event-mask (*root-window*) @@ -399,13 +405,7 @@ (slot-value master 'old-frame-style))) (multiple-value-bind (x y) (geometry-coordinates fgeometry) (with-slots (window) (or master ,application) - (configure-window window :x x :y y))))) - ;; reset appropriately _net_wm_state property. - (let ((prop (netwm:net-wm-state window))) - (if (eq ,mode :on) - (pushnew :_net_wm_state_fullscreen prop) - (setf prop (delete :_net_wm_state_fullscreen prop))) - (setf (netwm:net-wm-state window) prop)))) + (configure-window window :x x :y y))))))) (defun application-leader (application) "Returns the \"leader\" of an application. The leader is computed --- /project/eclipse/cvsroot/eclipse/wm.lisp 2005/03/13 23:37:07 1.51 +++ /project/eclipse/cvsroot/eclipse/wm.lisp 2007/05/04 08:26:14 1.52 @@ -1,5 +1,5 @@ ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*- -;;; $Id: wm.lisp,v 1.51 2005/03/13 23:37:07 ihatchondo Exp $ +;;; $Id: wm.lisp,v 1.52 2007/05/04 08:26:14 ihatchondo Exp $ ;;; ;;; ECLIPSE. The Common Lisp Window Manager. ;;; Copyright (C) 2000, 2001, 2002 Iban HATCHONDO @@ -366,22 +366,28 @@ "Returns as multiple values the decoration initial coordinates." (let ((hint (ignore-errors (xlib:wm-normal-hints app-window)))) (with-slots (top-margin left-margin vmargin hmargin) frame-style - (if (and hint (xlib:wm-size-hints-user-specified-position-p hint)) - (let ((x (xlib:wm-size-hints-x hint)) - (y (xlib:wm-size-hints-y hint))) - (case (xlib:wm-size-hints-win-gravity hint) - (:north-east (values (- x hmargin) y)) - (:south-east (values (- x hmargin) (- y vmargin))) - (:south-west (values x (- y vmargin))) - (:static (values (- x left-margin) (- y top-margin))) - (t (values x y)))) - (let* ((n (or (window-desktop-num app-window) 0)) - (k (if (= +any-desktop+ n) 0 (* 4 n))) - (areas (netwm:net-workarea *root-window*)) - (ax (aref areas k)) (ay (aref areas (1+ k)))) - (multiple-value-bind (x y) (window-position app-window) - (values (max ax (- x left-margin)) - (max ay (- y top-margin))))))))) + (flet ((default-coordinates () + (let* ((n (or (window-desktop-num app-window) 0)) + (k (if (= +any-desktop+ n) 0 (* 4 n))) + (areas (netwm:net-workarea *root-window*)) + (ax (aref areas k)) (ay (aref areas (1+ k)))) + (multiple-value-bind (x y) (window-position app-window) + (values (max ax (- x left-margin)) + (max ay (- y top-margin))))))) + (if (and hint (xlib:wm-size-hints-user-specified-position-p hint)) + (let ((x (xlib:wm-size-hints-x hint)) + (y (xlib:wm-size-hints-y hint))) + (if (and x y) + (case (xlib:wm-size-hints-win-gravity hint) + (:north-east (values (- x hmargin) y)) + (:south-east (values (- x hmargin) (- y vmargin))) + (:south-west (values x (- y vmargin))) + (:static (values (- x left-margin) (- y top-margin))) + (t (values x y))) + (progn + (format t "user-specified-position-p t but x or y isn't.") + (default-coordinates)))) + (default-coordinates)))))) (defun make-decoration (app-window application &key theme) "Returns a newly initialized decoration to hold the given application." @@ -431,8 +437,18 @@ (with-event-mask (master-window) (xlib:map-subwindows master-window)) (with-event-mask (master-window (when map +decoration-event-mask+)) - (xlib:reparent-window window master-window left-margin top-margin)) + (xlib:reparent-window window master-window left-margin top-margin) + (send-configuration-notify window)) (setf (application-frame-style application) (decoration-frame-style master)) + ;; handle maximized states. + (let* ((prop (netwm:net-wm-state window)) + (vert-p (member :_net_wm_state_maximized_vert prop)) + (horz-p (member :_net_wm_state_maximized_horz prop))) + (when (or vert-p horz-p) + (setf prop (delete :_net_wm_state_maximized_vert prop)) + (setf prop (delete :_net_wm_state_maximized_horz prop)) + (setf (netwm:net-wm-state window) prop) + (maximize application (if (and horz-p vert-p) 1 (if horz-p 3 2))))) (when map (xlib:map-window window)) master)) From ihatchondo at common-lisp.net Fri May 4 17:45:19 2007 From: ihatchondo at common-lisp.net (ihatchondo) Date: Fri, 4 May 2007 13:45:19 -0400 (EDT) Subject: [Eclipse-cvs] CVS eclipse Message-ID: <20070504174519.5DC6A581F9@common-lisp.net> Update of /project/eclipse/cvsroot/eclipse In directory clnet:/tmp/cvs-serv27826 Modified Files: misc.lisp Log Message: Fix: the max sizes were not properly computed. --- /project/eclipse/cvsroot/eclipse/misc.lisp 2007/05/04 08:26:14 1.36 +++ /project/eclipse/cvsroot/eclipse/misc.lisp 2007/05/04 17:45:19 1.37 @@ -1,5 +1,5 @@ ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*- -;;; $Id: misc.lisp,v 1.36 2007/05/04 08:26:14 ihatchondo Exp $ +;;; $Id: misc.lisp,v 1.37 2007/05/04 17:45:19 ihatchondo Exp $ ;;; ;;; This file is part of Eclipse. ;;; Copyright (C) 2002 Iban HATCHONDO @@ -333,11 +333,12 @@ (with-event-mask ((or parent win)) (when application ;; ensure width or height are compatible with wm-size-hints. - (multiple-value-bind (w h) - (geometry-sizes (find-max-geometry application 1 nil)) - (let* ((prop (netwm:net-wm-state win)) - (horz-p (member :_net_wm_state_maximized_horz prop)) - (vert-p (member :_net_wm_state_maximized_vert prop))) + (let* ((prop (netwm:net-wm-state win)) + (horz-p (member :_net_wm_state_maximized_horz prop)) + (vert-p (member :_net_wm_state_maximized_vert prop)) + (dir (if vert-p (if horz-p 1 2) 3))) + (multiple-value-bind (w h) + (geometry-sizes (find-max-geometry application dir nil)) (unless (member :_net_wm_state_fullscreen prop) (when width (setf width (if horz-p w (min width w)))) (when height (setf height (if vert-p h (min height h)))))))) From ihatchondo at common-lisp.net Mon May 7 00:19:13 2007 From: ihatchondo at common-lisp.net (ihatchondo) Date: Sun, 6 May 2007 20:19:13 -0400 (EDT) Subject: [Eclipse-cvs] CVS eclipse Message-ID: <20070507001913.C1F313F027@common-lisp.net> Update of /project/eclipse/cvsroot/eclipse In directory clnet:/tmp/cvs-serv7563 Modified Files: misc.lisp Log Message: Fix: - screen-window-layer computation when the window doesn't have any workspace number associated with. - make-viewport-property has only one viewport since we don't handled multiple viewport. --- /project/eclipse/cvsroot/eclipse/misc.lisp 2007/05/04 17:45:19 1.37 +++ /project/eclipse/cvsroot/eclipse/misc.lisp 2007/05/07 00:19:10 1.38 @@ -1,5 +1,5 @@ ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*- -;;; $Id: misc.lisp,v 1.37 2007/05/04 17:45:19 ihatchondo Exp $ +;;; $Id: misc.lisp,v 1.38 2007/05/07 00:19:10 ihatchondo Exp $ ;;; ;;; This file is part of Eclipse. ;;; Copyright (C) 2002 Iban HATCHONDO @@ -368,7 +368,7 @@ three layers (:_net_wm_state_below none :_net_wm_state_above) of the virtual screen that the given `window' argument belongs to. The given window will be filtered." - (loop with n = (if (eql i +any-desktop+) (current-desk) i) + (loop with n = (if (eql (or i +any-desktop+) +any-desktop+) (current-desk) i) for w in (screen-content n :skip-taskbar nil) for nwm-state = (netwm:net-wm-state w) unless (xlib:window-equal w window) @@ -454,7 +454,8 @@ rw :_eclipse_desktop_pointer_positions prop :CARDINAL 32)))) (defun make-viewport-property (n) - (make-list (* 2 n) :initial-element 0)) + (declare (ignore n)) + (make-list (* 2 1) :initial-element 0)) ;;;; Geometry structure and accessors. From ihatchondo at common-lisp.net Mon May 7 00:23:06 2007 From: ihatchondo at common-lisp.net (ihatchondo) Date: Sun, 6 May 2007 20:23:06 -0400 (EDT) Subject: [Eclipse-cvs] CVS eclipse Message-ID: <20070507002306.2A7CA431B7@common-lisp.net> Update of /project/eclipse/cvsroot/eclipse In directory clnet:/tmp/cvs-serv9824 Modified Files: input.lisp Log Message: Fix: map-request race condition when client remap its top-level before we handled its withdrawal demand. --- /project/eclipse/cvsroot/eclipse/input.lisp 2007/05/04 08:26:14 1.45 +++ /project/eclipse/cvsroot/eclipse/input.lisp 2007/05/07 00:23:05 1.46 @@ -1,5 +1,5 @@ ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*- -;;; $Id: input.lisp,v 1.45 2007/05/04 08:26:14 ihatchondo Exp $ +;;; $Id: input.lisp,v 1.46 2007/05/07 00:23:05 ihatchondo Exp $ ;;; ;;; ECLIPSE. The Common Lisp Window Manager. ;;; Copyright (C) 2000, 2001, 2002 Iban HATCHONDO @@ -217,7 +217,30 @@ ;;; Events for master (type: decoration) (defmethod event-process ((event map-request) (master decoration)) - (xlib:map-window (event-window event))) + ;; When a client has requested to withdraw its top-level and wants then + ;; to map it back so quickly that we haven't got honored yet its withdrawal + ;; demand, this event is in fact send to the wrong parent and should be re + ;; directed to the real parent of the client top-level. + ;; The events schema is: + ;; 1 -> map-request => procede-decoration + ;; 2 -> unmap-notify => unmap master + ;; 3 -> synthetic unmap-notify => undecore-application + ;; 4 -> map-request + ;; What happen is that the client ask for mapping its top-level (4) after + ;; sending the synthetic unmap-notify (3), but WE have not handled it yet + ;; (otherwise said undecore-application has not been called). So Xserver + ;; generates a map-request event for the known parent: US ! But as soon + ;; as undecore-application will occurred we won't be the parent anymore + ;; and this event should rather have been sent to the real parent + ;; (aka the root window). + (with-slots (window (parent event-window)) event + (multiple-value-bind (children real-parent) (xlib:query-tree window) + (declare (ignore children)) + (if (xlib:window-equal parent real-parent) + (xlib:map-window (event-window event)) + (xlib:send-event real-parent :map-request + '(:substructure-redirect) + :window window :event-window real-parent))))) (defmethod event-process ((event configure-notify) (master decoration)) (with-slots ((master-window event-window) (app-window window)) event From ihatchondo at common-lisp.net Mon May 7 13:22:50 2007 From: ihatchondo at common-lisp.net (ihatchondo) Date: Mon, 7 May 2007 09:22:50 -0400 (EDT) Subject: [Eclipse-cvs] CVS eclipse Message-ID: <20070507132250.D162C7E005@common-lisp.net> Update of /project/eclipse/cvsroot/eclipse In directory clnet:/tmp/cvs-serv26719 Modified Files: misc.lisp widgets.lisp input.lisp Log Message: Fix: - configure-window when configuring panel window should honor size without guessing anything (misc.lisp). - map-request race condition (input.lisp & widget.lisp) Added: - application-panel-p predicate (widget.lisp) --- /project/eclipse/cvsroot/eclipse/misc.lisp 2007/05/07 00:19:10 1.38 +++ /project/eclipse/cvsroot/eclipse/misc.lisp 2007/05/07 13:22:50 1.39 @@ -1,5 +1,5 @@ ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*- -;;; $Id: misc.lisp,v 1.38 2007/05/07 00:19:10 ihatchondo Exp $ +;;; $Id: misc.lisp,v 1.39 2007/05/07 13:22:50 ihatchondo Exp $ ;;; ;;; This file is part of Eclipse. ;;; Copyright (C) 2002 Iban HATCHONDO @@ -331,7 +331,7 @@ ;; update sizes. (when (or width height) (with-event-mask ((or parent win)) - (when application + (when (and application (not (application-panel-p application))) ;; ensure width or height are compatible with wm-size-hints. (let* ((prop (netwm:net-wm-state win)) (horz-p (member :_net_wm_state_maximized_horz prop)) --- /project/eclipse/cvsroot/eclipse/widgets.lisp 2007/05/04 08:26:14 1.47 +++ /project/eclipse/cvsroot/eclipse/widgets.lisp 2007/05/07 13:22:50 1.48 @@ -1,5 +1,5 @@ ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*- -;;; $Id: widgets.lisp,v 1.47 2007/05/04 08:26:14 ihatchondo Exp $ +;;; $Id: widgets.lisp,v 1.48 2007/05/07 13:22:50 ihatchondo Exp $ ;;; ;;; ECLIPSE. The Common Lisp Window Manager. ;;; Copyright (C) 2000, 2001, 2002 Iban HATCHONDO @@ -274,6 +274,10 @@ (setf (window-priority (if master (widget-window master) window) desk-w) (if desk-w :above :below))))) +(defun application-panel-p (application) + "Returns t if application is a panel (e.g: _net_wm_window_type_dock)." + (member :_net_wm_window_type_dock (application-type application))) + (defun fullscreenable-p (application) (with-slots (window) application (let ((hint (ignore-errors (xlib:wm-normal-hints window)))) @@ -443,7 +447,8 @@ (if master (multiple-value-bind (x y) (xlib:translate-coordinates window 0 0 *root-window*) - (xlib:reparent-window window *root-window* x y)) + (xlib:reparent-window window *root-window* x y) + (event-process (make-event :destroy-notify) master)) (event-process (make-event :destroy-notify :window window) *root*)) (when state (setf (wm-state window) state) --- /project/eclipse/cvsroot/eclipse/input.lisp 2007/05/07 00:23:05 1.46 +++ /project/eclipse/cvsroot/eclipse/input.lisp 2007/05/07 13:22:50 1.47 @@ -1,5 +1,5 @@ ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*- -;;; $Id: input.lisp,v 1.46 2007/05/07 00:23:05 ihatchondo Exp $ +;;; $Id: input.lisp,v 1.47 2007/05/07 13:22:50 ihatchondo Exp $ ;;; ;;; ECLIPSE. The Common Lisp Window Manager. ;;; Copyright (C) 2000, 2001, 2002 Iban HATCHONDO @@ -27,6 +27,30 @@ ;; Most general methods. +(defmethod event-process ((event map-request) null-widget) + ;; When a client has requested to withdraw its top-level and wants then + ;; to map it back so quickly that we haven't got honored yet its withdrawal + ;; demand, this event is in fact send to the wrong parent and should be re + ;; directed to the real parent of the client top-level. + ;; The events schema is: + ;; 1 -> map-request => procede-decoration + ;; 2 -> unmap-notify => unmap master + ;; 3 -> synthetic unmap-notify => undecore-application + ;; 4 -> map-request + ;; What happen is that the client ask for mapping its top-level (4) after + ;; sending the synthetic unmap-notify (3), but WE have not handled it yet + ;; (otherwise said undecore-application has not been called). So Xserver + ;; generates a map-request event for the known parent: US ! But as soon + ;; as undecore-application will occurred we won't be the parent anymore + ;; and this event should rather have been sent to the real parent + ;; (aka the root window). + (with-slots (window (candidat event-window)) event + (multiple-value-bind (children parent) (xlib:query-tree window) + (declare (ignore children)) + (unless (xlib:window-equal candidat parent) + (xlib:send-event parent :map-request + '(:substructure-redirect) :window window :event-window parent))))) + (defmethod event-process ((event mapping-notify) null-widget) (declare (ignorable null-widget)) (with-slots (request start count) event @@ -217,30 +241,7 @@ ;;; Events for master (type: decoration) (defmethod event-process ((event map-request) (master decoration)) - ;; When a client has requested to withdraw its top-level and wants then - ;; to map it back so quickly that we haven't got honored yet its withdrawal - ;; demand, this event is in fact send to the wrong parent and should be re - ;; directed to the real parent of the client top-level. - ;; The events schema is: - ;; 1 -> map-request => procede-decoration - ;; 2 -> unmap-notify => unmap master - ;; 3 -> synthetic unmap-notify => undecore-application - ;; 4 -> map-request - ;; What happen is that the client ask for mapping its top-level (4) after - ;; sending the synthetic unmap-notify (3), but WE have not handled it yet - ;; (otherwise said undecore-application has not been called). So Xserver - ;; generates a map-request event for the known parent: US ! But as soon - ;; as undecore-application will occurred we won't be the parent anymore - ;; and this event should rather have been sent to the real parent - ;; (aka the root window). - (with-slots (window (parent event-window)) event - (multiple-value-bind (children real-parent) (xlib:query-tree window) - (declare (ignore children)) - (if (xlib:window-equal parent real-parent) - (xlib:map-window (event-window event)) - (xlib:send-event real-parent :map-request - '(:substructure-redirect) - :window window :event-window real-parent))))) + (xlib:map-window (event-window event))) (defmethod event-process ((event configure-notify) (master decoration)) (with-slots ((master-window event-window) (app-window window)) event From ihatchondo at common-lisp.net Tue May 8 22:30:47 2007 From: ihatchondo at common-lisp.net (ihatchondo) Date: Tue, 8 May 2007 18:30:47 -0400 (EDT) Subject: [Eclipse-cvs] CVS eclipse Message-ID: <20070508223047.F1D104B022@common-lisp.net> Update of /project/eclipse/cvsroot/eclipse In directory clnet:/tmp/cvs-serv15180 Modified Files: rectangles.lisp Log Message: Cosmetic changes. --- /project/eclipse/cvsroot/eclipse/rectangles.lisp 2005/01/17 09:30:40 1.4 +++ /project/eclipse/cvsroot/eclipse/rectangles.lisp 2007/05/08 22:30:47 1.5 @@ -1,5 +1,5 @@ ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*- -;;; $Id: rectangles.lisp,v 1.4 2005/01/17 09:30:40 ihatchondo Exp $ +;;; $Id: rectangles.lisp,v 1.5 2007/05/08 22:30:47 ihatchondo Exp $ ;;; ;;; This file is part of Eclipse. ;;; Copyright (C) 2003 Iban HATCHONDO @@ -188,12 +188,12 @@ (wm-state (car (wm-state window)))) (and (or (= n scr-num) (= n +any-desktop+)) (or (eq wm-state 1) (and iconify-p (eq wm-state 3))) - (or (multiple-value-bind (resource class) + (or (member :_net_wm_window_type_dock + (netwm:net-wm-window-type window)) + (multiple-value-bind (resource class) (xlib:get-wm-class window) (declare (ignore resource)) - (string= class "Panel")) - (member :_net_wm_window_type_dock - (netwm:net-wm-window-type window))))))) + (string= class "Panel"))))))) (defun find-largest-empty-area (application &key area-include-me-p (panels-only-p t) direction From ihatchondo at common-lisp.net Tue May 8 22:33:17 2007 From: ihatchondo at common-lisp.net (ihatchondo) Date: Tue, 8 May 2007 18:33:17 -0400 (EDT) Subject: [Eclipse-cvs] CVS eclipse Message-ID: <20070508223317.4B28F4B022@common-lisp.net> Update of /project/eclipse/cvsroot/eclipse In directory clnet:/tmp/cvs-serv16158 Modified Files: eclipse.lisp Log Message: Fix: the settings of all the net-wm spec root properties is now surrounded with a with-server-grabbed to avoid tones of property change event on the root window. --- /project/eclipse/cvsroot/eclipse/eclipse.lisp 2006/01/14 15:40:55 1.25 +++ /project/eclipse/cvsroot/eclipse/eclipse.lisp 2007/05/08 22:33:17 1.26 @@ -1,5 +1,5 @@ ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*- -;;; $Id: eclipse.lisp,v 1.25 2006/01/14 15:40:55 ihatchondo Exp $ +;;; $Id: eclipse.lisp,v 1.26 2007/05/08 22:33:17 ihatchondo Exp $ ;;; ;;; ECLIPSE. The Common Lisp Window Manager. ;;; Copyright (C) 2002 Iban HATCHONDO @@ -129,27 +129,29 @@ (let ((first-desknum (current-vscreen window)) (nb-vs (number-of-virtual-screens window)) (srcw (screen-width)) (srch (screen-height))) - (delete-properties window (append +gnome-protocols+ +netwm-protocol+)) - (unless (< -1 first-desknum nb-vs) (setf first-desknum 0)) - (setf (gnome:win-protocols window) +gnome-protocols+ - (gnome:win-supporting-wm-check manager) manager - (gnome:win-supporting-wm-check window) manager - (gnome:win-workspace-count window) nb-vs - (gnome:win-workspace window) first-desknum - - (netwm:net-supported window) +netwm-protocol+ - (netwm:net-supporting-wm-check window) manager - (netwm:net-supporting-wm-check manager) manager - (netwm:net-wm-name manager) "eclipse" - (netwm:net-number-of-desktops window) nb-vs - (netwm:net-current-desktop window) first-desknum - (netwm:net-desktop-viewport window) (make-viewport-property nb-vs) - (netwm:net-desktop-geometry window) (list srcw srch) - (netwm:net-workarea window) (make-list nb-vs - :initial-element - (manager-commons:make-geometry-hint - :x 0 :y 0 :width srcw :height srch)) - ))) + (xlib:with-server-grabbed (*display*) + (delete-properties window +netwm-protocol+) + (unless (< -1 first-desknum nb-vs) (setf first-desknum 0)) + (setf (gnome:win-protocols window) +gnome-protocols+ + (gnome:win-supporting-wm-check manager) manager + (gnome:win-supporting-wm-check window) manager + (gnome:win-workspace-count window) nb-vs + (gnome:win-workspace window) first-desknum) + + (setf (netwm:net-supported window) +netwm-protocol+ + (netwm:net-supporting-wm-check window) manager + (netwm:net-supporting-wm-check manager) manager + (netwm:net-wm-name manager) "eclipse" + (netwm:net-number-of-desktops window) nb-vs + (netwm:net-current-desktop window) first-desknum + (netwm:net-desktop-viewport window) (make-viewport-property nb-vs) + (netwm:net-desktop-geometry window) (list srcw srch) + (netwm:net-workarea window) (make-list nb-vs + :initial-element + (manager-commons:make-geometry-hint + :x 0 :y 0 :width srcw :height srch)) + + )))) (defun initialize (display-specification sm-client-id) (multiple-value-bind (display screen) From ihatchondo at common-lisp.net Fri May 11 12:28:41 2007 From: ihatchondo at common-lisp.net (ihatchondo) Date: Fri, 11 May 2007 08:28:41 -0400 (EDT) Subject: [Eclipse-cvs] CVS eclipse Message-ID: <20070511122841.77F421901C@common-lisp.net> Update of /project/eclipse/cvsroot/eclipse In directory clnet:/tmp/cvs-serv14965 Modified Files: widgets.lisp Log Message: Fix: wm-size-hints might be nil. --- /project/eclipse/cvsroot/eclipse/widgets.lisp 2007/05/07 13:22:50 1.48 +++ /project/eclipse/cvsroot/eclipse/widgets.lisp 2007/05/11 12:28:40 1.49 @@ -1,5 +1,5 @@ ;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*- -;;; $Id: widgets.lisp,v 1.48 2007/05/07 13:22:50 ihatchondo Exp $ +;;; $Id: widgets.lisp,v 1.49 2007/05/11 12:28:40 ihatchondo Exp $ ;;; ;;; ECLIPSE. The Common Lisp Window Manager. ;;; Copyright (C) 2000, 2001, 2002 Iban HATCHONDO @@ -281,8 +281,8 @@ (defun fullscreenable-p (application) (with-slots (window) application (let ((hint (ignore-errors (xlib:wm-normal-hints window)))) - (symbol-macrolet ((max-w (xlib:wm-size-hints-max-width hint)) - (max-h (xlib:wm-size-hints-max-height hint))) + (symbol-macrolet ((max-h (and hint (xlib:wm-size-hints-max-height hint))) + (max-w (and hint (xlib:wm-size-hints-max-width hint)))) (and (if max-w (= max-w (screen-width)) t) (if max-h (= max-h (screen-height)) t))))))