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

More hacking.

change get-screen-content for screen-content. Some keyword parameter added.
parent 8cbc2b22
;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*-
;;; $Id: gestures.lisp,v 1.9 2003/10/06 17:57:26 ihatchondo Exp $
;;; $Id: gestures.lisp,v 1.10 2003/11/13 11:12:28 ihatchondo Exp $
;;; ECLIPSE. The Common Lisp Window Manager.
;;; Copyright (C) 2002 Iban HATCHONDO
......@@ -343,7 +343,7 @@
(unless *current-widget-info*
(setf *current-widget-info* (create-message-box nil :parent root-window)))
(let ((i (current-vscreen root-window)))
(setf *windows* (reverse (get-screen-content i :iconify-p *cycle-icons-p*))
(setf *windows* (reverse (screen-content i :iconify-p *cycle-icons-p*))
*depth* 0)))
(defun circulate-window-modifier-callback (event)
;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*-
;;; $Id: misc.lisp,v 1.12 2003/10/06 17:57:26 ihatchondo Exp $
;;; $Id: misc.lisp,v 1.13 2003/11/13 11:12:28 ihatchondo Exp $
;;; This file is part of Eclipse.
;;; Copyright (C) 2002 Iban HATCHONDO
......@@ -152,7 +152,7 @@
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)
for w in (get-screen-content n)
for w in (screen-content n)
for nwm-state = (netwm:net-wm-state w)
unless (xlib:window-equal w window)
if (member :_net_wm_state_above nwm-state) collect w into aboves
;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*-
;;; $Id: move-resize.lisp,v 1.7 2003/10/09 11:36:18 ihatchondo Exp $
;;; $Id: move-resize.lisp,v 1.8 2003/10/09 15:04:08 ihatchondo Exp $
;;; ECLIPSE. The Common Lisp Window Manager.
;;; Copyright (C) 2000, 2001, 2002 Iban HATCHONDO
......@@ -366,7 +366,7 @@
(with-slots (window active-p) widget
(setf (window-priority window) :above)
(setf active-p t
*screen-windows* (get-screen-content (current-desk))
*screen-windows* (screen-content (current-desk))
*delta-x* (- (event-root-x event) (xlib:drawable-x window))
*delta-y* (- (event-root-y event) (xlib:drawable-y window)))))
;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*-
;;; $Id: virtual-screen.lisp,v 1.10 2003/10/09 11:39:41 ihatchondo Exp $
;;; $Id: virtual-screen.lisp,v 1.11 2003/11/13 11:12:28 ihatchondo Exp $
;;;Copyright (C) 2002 Iban HATCHONDO
;;; contact :
......@@ -23,17 +23,23 @@
;;;; Private
(defun window-belongs-to-vscreen-p (win scr-num iconify-p)
(defun window-belongs-to-vscreen-p
(win scr-num iconify-p skip-taskbar skip-desktop skip-dock)
(when (lookup-widget win)
(let ((n (or (window-desktop-num win) -1))
(wm-state (car (wm-state win)))
(netwm-type (netwm:net-wm-window-type win)))
(netwm-type (netwm:net-wm-window-type win))
(netwm-state (netwm:net-wm-state win)))
(and (or (= n scr-num) (= n +any-desktop+))
(or (eq wm-state 1) (and iconify-p (eq wm-state 3)))
(not (member :win_hints_skip_taskbar (gnome:win-hints win)))
(not (member :_net_wm_state_skip_taskbar (netwm:net-wm-state win)))
(not (member :_net_wm_window_type_desktop netwm-type))
(not (member :_net_wm_window_type_dock netwm-type))))))
(not (and skip-taskbar
(member :_net_wm_state_skip_taskbar netwm-state)))
(not (and skip-taskbar
(member :win_hints_skip_taskbar (gnome:win-hints win))))
(not (and skip-desktop
(member :_net_wm_window_type_desktop netwm-type)))
(not (and skip-dock
(member :_net_wm_window_type_dock netwm-type)))))))
(defun map-or-unmap-vscreen (fun scr-num)
(loop for widget being each hash-value in *widget-table*
......@@ -109,16 +115,28 @@
(or (nth new (workspace-names window))
(format nil "WORKSPACE ~D" new))))))))
(defun get-screen-content (scr-num &key iconify-p)
(defun screen-content (scr-num
&key (predicate #'window-belongs-to-vscreen-p) iconify-p
(skip-taskbar t) (skip-desktop t) (skip-dock t))
"Returns the list of application's windows that represent the contents
of the given virtual screen. Use :iconify-p t to includes iconfied windows"
(loop for win in (query-application-tree *root-window*)
when (window-belongs-to-vscreen-p win scr-num iconify-p) collect win))
of the given virtual screen.
:iconify-p to include or not iconfied windows (default nil).
:skip-taskbar to include window with skip-taskbar hint (default t).
:skip-desktop to include window with desktop window type (default t).
:skip-dock to include window with dock window type (default t).
:predicate a function of six arguments:
window screen-number iconify-p skip-taskbar-p skip-desktop-p skip-dock-p."
(loop with i = (if (eql scr-num +any-desktop+) (current-desk) scr-num)
for w in (query-application-tree *root-window*)
when (funcall
predicate w i iconify-p skip-taskbar skip-desktop skip-dock)
collect w))
(defun give-focus-to-next-widget-in-desktop ()
"Gives the focus to the window that is on top of the stacking order."
(loop with given-p = nil
for window in (reverse (get-screen-content (current-desk)))
for window in (reverse (screen-content (current-desk)))
when (eq :viewable (xlib:window-map-state window))
do (with-slots (input-model) (lookup-widget window)
(unless (eq input-model :no-input)
......@@ -132,7 +150,7 @@
(defmethod circulate-window
((root root) &key direction (nth 0) icon-p windows (desk (current-desk)))
(unless windows
(setf windows (reverse (get-screen-content desk :iconify-p icon-p))))
(setf windows (reverse (screen-content desk :iconify-p icon-p))))
(or windows (return-from circulate-window nil))
(let ((length (length windows)))
(setf nth (mod nth length))
;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*-
;;; $Id: wm.lisp,v 1.21 2003/10/06 17:57:26 ihatchondo Exp $
;;; $Id: wm.lisp,v 1.22 2003/10/09 11:37:08 ihatchondo Exp $
;;; ECLIPSE. The Common Lisp Window Manager.
;;; Copyright (C) 2000, 2001, 2002 Iban HATCHONDO
......@@ -590,7 +590,7 @@
(3 (uniconify (slot-value (lookup-widget window) 'icon))))
(put-on-top (lookup-widget window))))
(make-desktop-entries (index)
(loop for w in (get-screen-content index :iconify-p t)
(loop for w in (screen-content index :iconify-p t)
for state = (= 1 (first (wm-state w)))
collect (cons (format nil "~:[[ ~A ]~;~A~]" state (wm-name w))
(raise w index)))))
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