20
20
;; along with sawfish; see the file COPYING. If not, write to
21
21
;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
34
; #### ; This Software is Not Good Software.
36
; #### # ; The Tao of Sawfish is that
37
; ## ; a Window Manager Manages Windows.
39
; # ; That is How It Should Be.
41
; # ### ; That is Right.
43
; # ### ; This Software violates the Tao of
44
; # ### ; Sawfish by making the window manager
45
; # ####### ; do what it should not.
47
; ######## ; The Purity of Sawfish is Sullied by
48
; # ######### ; this Software.
50
; ### ; This Software Should Not Be.
52
; # # ; Do not use this Software.
53
; ##################### ;
54
; ##################### ; Merely observe, weep, gnash of your
55
; # ## # ; teeth and pull of your hair.
59
; ###### ## ## ; Use instead a real icon manager
60
; ### ####### ; based on stph or somesuch.
63
; ##################### ;
64
; # ### ; Let me reiterate one more time
65
; ###### ; before I'm drunk again:
67
; ####### ; This software is a retrograde step.
69
; ####### ; The Purity And Lightness of Sawfish
70
; ###### # ; is its Greatness.
71
; ##################### ;
72
; ; A Window Manager should not include
73
; # # ; Applications such as this.
74
; ##################### ;
75
; ##################### ; Discrete applications can do a much
78
; # # ; This Software is a return to the old
79
; ##################### ; ways of proprietary gadgets on
80
; # ### ; bloated, unstable window managers.
84
; ####### ; For the love of all that is good,
85
; ####### ; turn back now.
87
; ##################### ;
102
23
;;;;;;;;;;;;;;;;;;;;;
103
24
;; HERE BE DRAGONS ;;
104
25
;;;;;;;;;;;;;;;;;;;;;
336
(define (icons-event-expose event)
338
((window (cdr (assq 'window event)))
339
(w (x-window-get window 'parent)))
257
(define (expose-handler window event)
259
((w (x-window-get window 'parent)))
342
(define (icons-event-enter-notify event)
344
((window (cdr (assq 'window event)))
345
(w (x-window-get window 'parent)))
263
(define (enter-notify-handler window event)
265
((w (x-window-get window 'parent)))
346
266
(when icons-tooltips
347
267
(let ((tooltips-enabled t))
348
(display-tooltip-after-delay (window-name w) (icons-get-icon w))))))
350
(define (icons-event-leave-notify event)
352
((window (cdr (assq 'window event)))
353
(w (x-window-get window 'parent)))
357
(define (icons-event-client-message event)
359
((window (cdr (assq 'window event)))
360
(message-type (cdr (assq 'message-type event)))
268
(display-tooltip-after-delay (window-name w) (icons-get-icon w)))))
271
(define (leave-notify-handler window event)
276
(define (client-message-handler window event)
278
((message-type (cdr (assq 'message-type event)))
361
279
(format (cdr (assq 'format event)))
362
280
(data (cdr (assq 'data event)))
363
281
(w (x-window-get window 'parent)))
364
282
(when (and (eq message-type 'WM_PROTOCOLS)
366
284
(eq (aref data 0) (x-atom 'WM_DELETE_WINDOW)))
367
(uniconify-window w)))) ;; or do I just delete the icon?
369
(define (icons-event-handler type win event)
370
(cond ((eq type 'expose) (icons-event-expose event))
371
((eq type 'enter-notify) (icons-event-enter-notify event))
372
((eq type 'leave-notify) (icons-event-leave-notify event))
373
((eq type 'client-message) (icons-event-client-message event))))
285
(uniconify-window w)))
286
nil) ;; or do I just delete the icon?
288
(define background-event-handlers
289
`((expose . ,expose-handler)
290
(enter-notify . ,enter-notify-handler)
291
(leave-notify . ,leave-notify-handler)))
293
(define window-event-handlers
294
`((client-message . ,client-message-handler)))
296
(define (event-handler type window event handlers)
298
((handler (assq type handlers)))
300
((cdr handler) window event))))
398
326
(border-color . ,(cdr icons-border))
399
327
(override-redirect . ,t)
400
328
(event-mask . ,'(exposure enter-window leave-window)))
401
icons-event-handler))
329
(lambda (type window event)
330
(event-handler type window event background-event-handlers))))
404
333
`((foreground . ,(car icons-text))))))