Commit ead717fb authored by Iban Hatchondo's avatar Iban Hatchondo
Browse files

display-error-handler now updates the root's client lists when the resource...

display-error-handler now updates the root's client lists when the resource that was the source of the error is not our widget table. For that purpose the update-lists function had been splits into two functions:
 {add,remove}-window-{in,from}-client-lists
parent 14d3d60f
;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*-
;;; $Id: global.lisp,v 1.21 2004/03/04 14:51:48 ihatchondo Exp $
;;; $Id: global.lisp,v 1.22 2004/03/09 19:26:27 ihatchondo Exp $
;;;
;;; This file is part of Eclipse.
;;; Copyright (C) 2001, 2002 Iban HATCHONDO
......@@ -204,12 +204,15 @@
(format *stderr*
"X error ~A ~:[~;with id~]~%=> ~{~A ~}~%"
err resource-id keys)
(when (and resource-id (not asynchronous))
(when resource-id
(let* ((resource (xlib::lookup-window dpy resource-id))
(widget (lookup-widget resource)))
(when (and widget (application-p widget))
(event-process (make-event :destroy-notify :window resource)
(or (application-master widget) *root*))
(format *stderr* "Dead window removed from table~%"))))
(if widget
(when (and (not asynchronous) (application-p widget))
(event-process (make-event :destroy-notify :window resource)
(or (application-master widget) *root*))
(format *stderr* "Dead window removed from table~%"))
(when (member resource-id (netwm:net-client-list *root-window*))
(remove-window-from-client-lists resource *root*)))))
(finish-output *stderr*)
(error 'already-handled-xerror))
;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*-
;;; $Id: wm.lisp,v 1.42 2004/03/09 19:26:27 ihatchondo Exp $
;;; $Id: wm.lisp,v 1.43 2004/03/10 15:58:17 ihatchondo Exp $
;;;
;;; ECLIPSE. The Common Lisp Window Manager.
;;; Copyright (C) 2000, 2001, 2002 Iban HATCHONDO
......@@ -673,25 +673,26 @@
(cons "Destroy" (lambda () (kill-client-window appw)))
(cons "Iconify" (lambda () (iconify app)))))))
(defun update-lists (app state root)
"Update root properties win_client_list, net_client_list(_stacking),
by adjoining or removing the given application depending of state."
(with-slots ((appw window) iconic-p) app
(with-slots ((rw window) client-list) root
(case (if (and (= state 3) (not iconic-p)) 0 state)
(0 (remhash appw client-list)
(setf (netwm:net-client-list-stacking rw :mode :remove) appw
(gnome:win-client-list rw :mode :remove) appw
(netwm:net-client-list rw :mode :remove) appw))
(1 (let ((up2date (gethash appw client-list)))
(setf (gethash appw client-list) appw)
(update-client-list-stacking root)
(unless up2date
(setf (netwm:net-client-list rw :mode :append) appw))
(if (member :win_hints_skip_winlist (gnome:win-hints appw))
(setf (gnome:win-client-list rw :mode :remove) appw)
(unless up2date
(setf (gnome:win-client-list rw :mode :append) appw)))))))))
(defun remove-window-from-client-lists (window root)
"Removes a window from the client lists root properties."
(with-slots ((rw window) client-list) root
(remhash window client-list)
(setf (netwm:net-client-list-stacking rw :mode :remove) window
(gnome:win-client-list rw :mode :remove) window
(netwm:net-client-list rw :mode :remove) window)))
(defun add-window-in-client-lists (window root)
"Add a window in the client lists root properties."
(with-slots ((rw window) client-list) root
(let ((up2date (gethash window client-list)))
(setf (gethash window client-list) window)
(update-client-list-stacking root)
(unless up2date
(setf (netwm:net-client-list rw :mode :append) window))
(if (member :win_hints_skip_winlist (gnome:win-hints window))
(setf (gnome:win-client-list rw :mode :remove) window)
(unless up2date
(setf (gnome:win-client-list rw :mode :append) window))))))
(defun update-client-list-stacking (root)
"Recompute ans set the root property net_client_list_stacking."
......@@ -700,6 +701,15 @@
when (gethash win client-list) collect win into wins
finally (setf (netwm:net-client-list-stacking window) wins))))
(defun update-lists (app state root)
"Update root properties win_client_list, net_client_list(_stacking),
by adjoining or removing the given application depending of state."
(with-slots ((appw window) iconic-p) app
(with-slots ((rw window) client-list) root
(case (if (and (= state 3) (not iconic-p)) 0 state)
(0 (remove-window-from-client-lists appw root))
(1 (add-window-in-client-lists appw root))))))
(defun window-not-decorable-p (window &optional type)
"Return T if a window `should' not be decorated. Typically, a splash screen,
a desktop (e.g. nautilus) or a dock (e.g. gnome panels) will be assumed as
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment