altlinux/defaults.jl | 2 + altlinux/menu.jl | 8 ++ altlinux/site-init.jl | 10 ++ data/sawfish-gnome2.desktop | 4 + lisp/sawfish/cfg/i18n.jl | 4 +- lisp/sawfish/wm.jl | 4 +- lisp/sawfish/wm/frames.jl | 3 + lisp/sawfish/wm/keymaps.jl | 8 ++ lisp/sawfish/wm/placement/dockapp.jl | 144 +++++++++++++++++++++ lisp/sawfish/wm/windows.jl | 28 +++++ man/sawfish.texi | 7 +- menu-method | 27 ++++ sawfish-48.xpm | 235 +++++++++++++++++++++++++++++++++++ src/fonts.c | 4 +- src/windows.c | 24 +++- 15 files changed, 503 insertions(+), 9 deletions(-) diff --git a/altlinux/defaults.jl b/altlinux/defaults.jl new file mode 100644 index 00000000..736a17b6 --- /dev/null +++ b/altlinux/defaults.jl @@ -0,0 +1,2 @@ +; load the sawfish defaults +(require 'sawfish-defaults) diff --git a/altlinux/menu.jl b/altlinux/menu.jl new file mode 100644 index 00000000..296577d6 --- /dev/null +++ b/altlinux/menu.jl @@ -0,0 +1,8 @@ +; load the altlinux menu +(require 'rep.i18n.gettext) +(let + ((olddomain (textdomain "menu-messages"))) + (require 'altlinux-menu) + (textdomain olddomain)) +; install it +(setq apps-menu altlinux-menu) diff --git a/altlinux/site-init.jl b/altlinux/site-init.jl new file mode 100644 index 00000000..90a80ba4 --- /dev/null +++ b/altlinux/site-init.jl @@ -0,0 +1,10 @@ +(setq load-path (nconc load-path (list "/etc/X11/sawfish"))) +(let* + ((dir "/etc/X11/sawfish/site-init.d") + (files (and (file-directory-p dir) (directory-files dir)))) + (mapc + (lambda (file) + (condition-case data + (load (expand-file-name file dir) t t t) + (error (error-handler-function (car data) (cdr data))))) + (sort files))) diff --git a/data/sawfish-gnome2.desktop b/data/sawfish-gnome2.desktop index acd39a22..5aa010a5 100644 --- a/data/sawfish-gnome2.desktop +++ b/data/sawfish-gnome2.desktop @@ -7,7 +7,11 @@ ConfigExec=sawfish-config ConfigTryExec=sawfish-config Terminal=false NoDisplay=true +# name we put on the WM spec check window X-GNOME-WMName=Sawfish X-GNOME-Autostart-Phase=WindowManager X-GNOME-Provides=windowmanager X-GNOME-Autostart-Notify=true + +[Window Manager] +SessionManaged=true diff --git a/lisp/sawfish/cfg/i18n.jl b/lisp/sawfish/cfg/i18n.jl index e3f2f8fc..b2006da4 100644 --- a/lisp/sawfish/cfg/i18n.jl +++ b/lisp/sawfish/cfg/i18n.jl @@ -57,6 +57,8 @@ (let ((locale-dir (wm-locale-dir))) (when locale-dir (bindtextdomain "sawfish" locale-dir) + (bindtextdomain "menu-messages" locale-dir) (when (boundp 'bindtextdomaincodeset) - (bindtextdomaincodeset "sawfish" "UTF-8")) + (bindtextdomaincodeset "sawfish" "UTF-8") + (bindtextdomaincodeset "menu-messages" "UTF-8")) (textdomain "sawfish")))))) diff --git a/lisp/sawfish/wm.jl b/lisp/sawfish/wm.jl index 1b51d740..a65b94a7 100644 --- a/lisp/sawfish/wm.jl +++ b/lisp/sawfish/wm.jl @@ -49,8 +49,10 @@ (when (and lang (not disable-nls) (not (string= lang "C"))) (require 'rep.i18n.gettext) (bindtextdomain "sawfish" sawfish-locale-directory) + (bindtextdomain "menu-messages" sawfish-locale-directory) (when (boundp 'bindtextdomaincodeset) - (bindtextdomaincodeset "sawfish" "UTF-8")) + (bindtextdomaincodeset "sawfish" "UTF-8") + (bindtextdomaincodeset "menu-messages" "UTF-8")) (textdomain "sawfish")))) ;; ignore file errors on stdio streams diff --git a/lisp/sawfish/wm/frames.jl b/lisp/sawfish/wm/frames.jl index e34d7b80..ccdd6102 100644 --- a/lisp/sawfish/wm/frames.jl +++ b/lisp/sawfish/wm/frames.jl @@ -159,6 +159,7 @@ that overrides settings set elsewhere.") (shaded-transient . shaped-transient) (icon . shaped-transient) (dock . unframed) + (dockapp . unframed) (utility . default) (shaded-utility . shaded-transient) (toolbar . unframed) @@ -1045,6 +1046,8 @@ generate.") (define-frame-class 'title `((keymap . title-keymap) (cursor . ,(cursor-for-frame-part 'title)))) + (define-frame-class 'appicon '((keymap . appicon-keymap))) + (define-frame-class 'tabbar-horizontal `((keymap . tabbar-keymap) (cursor . ,(cursor-for-frame-part 'title)))) diff --git a/lisp/sawfish/wm/keymaps.jl b/lisp/sawfish/wm/keymaps.jl index e78eddd9..6c8980f1 100644 --- a/lisp/sawfish/wm/keymaps.jl +++ b/lisp/sawfish/wm/keymaps.jl @@ -232,6 +232,14 @@ :group bindings :type keymap) + (defcustom appicon-keymap (bind-keys (make-keymap) + "Button1-Move" 'move-window-interactively + "Button1-Click1" 'popup-window-menu) + "Keymap containing bindings active when the pointer is in the appicon of +a window. (Only mouse-bindings are evaluated in this map.)" + :group bindings + :type keymap) + (defcustom next-workspace-button-keymap (bind-keys (make-keymap) "Button3-Off" 'send-to-previous-workspace "Button2-Click" 'popup-workspace-list diff --git a/lisp/sawfish/wm/placement/dockapp.jl b/lisp/sawfish/wm/placement/dockapp.jl new file mode 100644 index 00000000..16b48947 --- /dev/null +++ b/lisp/sawfish/wm/placement/dockapp.jl @@ -0,0 +1,144 @@ +;; dockapp-placement.jl -- ``dockapp'' window placement + +;; Copyright (C) 2010 Alexey I. Froloff + +;; This file is part of sawfish. + +;; sawfish is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; sawfish is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with sawfish; see the file COPYING. If not, write to +;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +(define-structure sawfish.wm.placement.dockapp + + (export ) + + (open + rep + rep.regexp + rep.system + sawfish.wm.custom + sawfish.wm.events + sawfish.wm.frames + sawfish.wm.misc + sawfish.wm.placement + sawfish.wm.windows) + + (defconst WMIconSize 64) + + (defgroup dockapps "Dockapps" + :group (misc placement) + :require sawfish.wm.placement.dockapp) + + (defcustom dockapps-placement-origin 'south-west + "Dockapp placement origin: \\w" + :type (choice north-west north-east south-east south-west) + :group (misc placement dockapps)) + + (defcustom dockapps-placement-direction 'east + "Dockapp placement direction: \\w" + :type (choice north east south west) + :group (misc placement dockapps)) + + (define dockapps-origin-x (case dockapps-placement-origin + ((north-west south-west) 0) + ((north-east south-east) (- (screen-width) WMIconSize)))) + (define dockapps-origin-y (case dockapps-placement-origin + ((north-east north-west) 0) + ((south-east south-west) (- (screen-height) WMIconSize)))) + (define dockapps-per-line (case dockapps-placement-direction + ((east west) (quotient (screen-width) WMIconSize)) + ((north south) (quotient (screen-height) WMIconSize)))) + + (define (dockapp-slot-pos n) + "Returns screen coordinates of nth dockapp slot." + (cons (case dockapps-placement-direction + ((north south) (case dockapps-placement-origin + ((north-west south-west) + (+ dockapps-origin-x (* (quotient n dockapps-per-line) WMIconSize))) + ((north-east south-east) + (- dockapps-origin-x (* (quotient n dockapps-per-line) WMIconSize))))) + ((east) (+ dockapps-origin-x (* (% n dockapps-per-line) WMIconSize))) + ((west) (- dockapps-origin-x (* (% n dockapps-per-line) WMIconSize)))) + (case dockapps-placement-direction + ((east west) (case dockapps-placement-origin + ((north-west north-east) + (+ dockapps-origin-y (* (quotient n dockapps-per-line) WMIconSize))) + ((south-west south-east) + (- dockapps-origin-y (* (quotient n dockapps-per-line) WMIconSize))))) + ((south) (+ dockapps-origin-y (* (% n dockapps-per-line) WMIconSize))) + ((north) (- dockapps-origin-y (* (% n dockapps-per-line) WMIconSize)))))) + + (define (dockapps-around point) + "Returns list of dockapp windows around given point." + (filter-windows + (lambda (w) + (and (dockapp-window-p w) + (window-get w 'placed) + (let ((w-point (window-position w))) + (and (< (abs (- (car w-point) (car point))) (/ WMIconSize 2)) + (< (abs (- (cdr w-point) (cdr point))) (/ WMIconSize 2)))))))) + + (define (snap-dockapp w) + "Snap dockapp window to placement origin." + (let* ((w-pos (window-position w)) + (x (car w-pos)) + (y (cdr w-pos)) + (slot + (case dockapps-placement-direction + ((north south) + (% (min (quotient (+ (abs (- dockapps-origin-y y)) + (/ WMIconSize 2)) + WMIconSize) + (1- dockapps-per-line)) + dockapps-per-line)) + ((east west) + (% (min (quotient (+ (abs (- dockapps-origin-x x)) + (/ WMIconSize 2)) + WMIconSize) + (1- dockapps-per-line)) + dockapps-per-line))))) + (window-put w 'placed nil) + (while (dockapps-around (dockapp-slot-pos slot)) + (setq slot (+ slot dockapps-per-line))) + (let ((point (dockapp-slot-pos slot))) + ;;;; Unbound variable: backquote-splice + ;;(move-window-to w ,@(dockapp-slot-pos slot)) + (move-window-to w (car point) (cdr point)) + (window-put w 'placed t)))) + + (define (snap-window-if-dockapp w) + "Snap window toplacement origin if it's dockapp." + (when (dockapp-window-p w) + (snap-dockapp w))) + + (add-hook 'after-move-hook snap-window-if-dockapp) + (add-hook 'enter-workspace-hook (lambda () + (mapc snap-window-if-dockapp + (managed-windows)))) + + (define (place-dockapp w) + "Place new dockapp window on free space." + (let ((placed nil) + (i 0)) + (while (not placed) + (let ((point (dockapp-slot-pos i))) + (if (dockapps-around point) + (setq i (1+ i)) + ;;;; Unbound variable: backquote-splice + ;;(move-window-to w ,@point) + (move-window-to w (car point) (cdr point)) + (window-put w 'placed t) + (setq placed t)))))) + + ;;###autoload + (define-placement-mode 'dockapp place-dockapp)) diff --git a/lisp/sawfish/wm/windows.jl b/lisp/sawfish/wm/windows.jl index e6f25c2b..ea6cb42f 100644 --- a/lisp/sawfish/wm/windows.jl +++ b/lisp/sawfish/wm/windows.jl @@ -36,6 +36,8 @@ mark-window-as-desktop dock-window-p mark-window-as-dock + dockapp-window-p + mark-window-as-dockapp window-in-cycle-p window-class window-pid @@ -120,6 +122,12 @@ sticky-viewport placed) "List of properties set (to true) on windows when they are marked as docks.") + (defvar dockapp-window-properties + '(never-focus cycle-skip window-list-skip task-list-skip avoid sticky + sticky-viewport ignore-program-position never-iconify + never-maximize no-history) + "List of properties set (to true) on windows when they are marked as dockapps.") + (defvar desktop-window-properties '(fixed-position sticky sticky-viewport) "List of properties set (to true) on windows when they are marked as desktops.") @@ -130,6 +138,9 @@ (defvar dock-window-depth 0 "The stacking depth of dock windows.") + (defvar dockapp-window-depth -1 + "The stacking depth of dockapp windows.") + (defvar activate-window-hook nil) ;;; finding windows, reading properties @@ -241,6 +252,23 @@ then be the numeric id of its parent window." (set-window-type w 'dock) (set-window-depth w dock-window-depth)) + (define (dockapp-window-p arg) + "Return true if ARG represents a dockapp window." + (and (windowp arg) (window-get arg 'dockapp-type))) + + (define (mark-window-as-dockapp w) + "Mark that the window associated with object W is a dockapp window." + (require 'sawfish.wm.stacking) + (require 'sawfish.wm.frames) + (require 'sawfish.wm.util.groups) + (window-put w 'dockapp-type t) + (mapc (lambda (p) + (window-put w p t)) dockapp-window-properties) + (set-window-type w 'dockapp) + (set-window-depth w dockapp-window-depth) + (add-window-to-group w 'dockapps) + (window-put w 'place-mode 'dockapp)) + (define (window-in-cycle-p w #!key ignore-cycle-skip) "Returns true if the window W should be included when cycling between windows." diff --git a/man/sawfish.texi b/man/sawfish.texi index 781f5acb..31ecec97 100644 --- a/man/sawfish.texi +++ b/man/sawfish.texi @@ -3706,7 +3706,9 @@ Defines the width of the frame part. Defines the height of the frame part. @item (border-width . @var{value}) -@itemx (border-color . @var{value}) +Defines window border width. + +@item (border-color . @var{value}) Defines the border width and color. A ``border'' if present surrounds the window and all other frame parts. Both width and color are applied to the whole window instead of current frame part. (Thus they should @@ -3747,6 +3749,9 @@ function will be called (with a single argument, the window object) when the frame is constructed, the value returned will be used as the actual value of the attribute. +The values specified for the @code{border-width} and @code{border-color} +are applied for the whole window instead of current frame part. + The coordinate system used for specifying the part's position is relative to the window edge that the position is defined against. Positive values count in from the window edge towards the center of the diff --git a/menu-method b/menu-method new file mode 100644 index 00000000..04533e24 --- /dev/null +++ b/menu-method @@ -0,0 +1,27 @@ +#!/usr/bin/install-menu + +!include menu.h +compat="menu-2"; +outputencoding="UTF-8"; +outputlanguage="C"; + +userprefix=".sawfish/lisp"; +rootprefix="/etc/X11/sawfish"; +genmenu="altlinux-menu.jl"; +rootsection="ALTLinux"; + +function label($arg)=tolower(replacewith($arg,"/ ","--")); +function q($arg)=esc($arg,"\"\\"); + +supported; + x11=" (,(_ \"" q(title()) "\") (system \"exec " q($command) " &\"))" ifneq(entryindex(), sub(entrycount(), "1"), "\n"); + text=" (,(_ \"" q(title()) "\") (system \"exec " q(term()) " &\"))" ifneq(entryindex(), sub(entrycount(), "1"), "\n"); + wm=" (,(_ \"" q(title()) "\") (progn (setq saved-command-line-args '(\"" q($command) "\")) (restart)))" ifneq(entryindex(), sub(entrycount(), "1"), "\n"); +endsupported; + +preoutput=";; This is -*-Lisp-*-\n;; Automagically generated file. Do not edit (see /usr/doc/menu/html/index.html)\n\n(provide 'altlinux-menu)\n\n"; + +startmenu="(defvar " label($section)"-menu\n `(\n"; +endmenu="))\n"; +submenutitle=" (,(_ \"" q(title()) "\") . " label($section) "-menu)" ifneq(entryindex(), sub(entrycount(), "1"), "\n"); +sort=title() diff --git a/sawfish-48.xpm b/sawfish-48.xpm new file mode 100644 index 00000000..9641fe26 --- /dev/null +++ b/sawfish-48.xpm @@ -0,0 +1,235 @@ +/* XPM */ +static char * gimp_temp_127540_xpm[] = { +"48 47 185 2", +" c None", +". c #000000", +"+ c #0B0B0B", +"@ c #2A2A2A", +"# c #4D4D4D", +"$ c #686868", +"% c #555555", +"& c #2E2E2E", +"* c #303030", +"= c #9C9C9C", +"- c #DBDBDB", +"; c #EAEAEA", +"> c #E7E7E7", +", c #A8A8A8", +"' c #282828", +") c #101010", +"! c #393939", +"~ c #585858", +"{ c #171717", +"] c #050505", +"^ c #696969", +"/ c #D7D7D7", +"( c #E0E0E0", +"_ c #A1A1A1", +": c #292929", +"< c #0C0C0C", +"[ c #1E1E1E", +"} c #404040", +"| c #656565", +"1 c #7A7A7A", +"2 c #787878", +"3 c #444444", +"4 c #1D1D1D", +"5 c #353535", +"6 c #A7A7A7", +"7 c #7C7C7C", +"8 c #090909", +"9 c #616161", +"0 c #E5E5E5", +"a c #E4E4E4", +"b c #6B6B6B", +"c c #B9B9B9", +"d c #E6E6E6", +"e c #E8E8E8", +"f c #BABABA", +"g c #6F6F6F", +"h c #DDDDDD", +"i c #898989", +"j c #020202", +"k c #5B5B5B", +"l c #E2E2E2", +"m c #D8D8D8", +"n c #030303", +"o c #C9C9C9", +"p c #D0D0D0", +"q c #323232", +"r c #010101", +"s c #4E4E4E", +"t c #DFDFDF", +"u c #EBEBEB", +"v c #212121", +"w c #181818", +"x c #C7C7C7", +"y c #828282", +"z c #8D8D8D", +"A c #D4D4D4", +"B c #C0C0C0", +"C c #515151", +"D c #4F4F4F", +"E c #838383", +"F c #626262", +"G c #2C2C2C", +"H c #CACACA", +"I c #E9E9E9", +"J c #767676", +"K c #DEDEDE", +"L c #606060", +"M c #797979", +"N c #DADADA", +"O c #3A3A3A", +"P c #CFCFCF", +"Q c #CECECE", +"R c #919191", +"S c #A3A3A3", +"T c #B4B4B4", +"U c #040404", +"V c #060606", +"W c #1B1B1B", +"X c #D6D6D6", +"Y c #8C8C8C", +"Z c #D9D9D9", +"` c #707070", +" . c #1F1F1F", +".. c #999999", +"+. c #191919", +"@. c #6D6D6D", +"#. c #A6A6A6", +"$. c #D3D3D3", +"%. c #414141", +"&. c #D2D2D2", +"*. c #BCBCBC", +"=. c #494949", +"-. c #8B8B8B", +";. c #C1C1C1", +">. c #202020", +",. c #C6C6C6", +"'. c #BDBDBD", +"). c #E3E3E3", +"!. c #0E0E0E", +"~. c #808080", +"{. c #575757", +"]. c #080808", +"^. c #B7B7B7", +"/. c #535353", +"(. c #070707", +"_. c #7D7D7D", +":. c #3D3D3D", +"<. c #5E5E5E", +"[. c #5F5F5F", +"}. c #B5B5B5", +"|. c #E1E1E1", +"1. c #121212", +"2. c #5D5D5D", +"3. c #9F9F9F", +"4. c #0A0A0A", +"5. c #3F3F3F", +"6. c #B2B2B2", +"7. c #4A4A4A", +"8. c #5C5C5C", +"9. c #232323", +"0. c #CCCCCC", +"a. c #BEBEBE", +"b. c #111111", +"c. c #A2A2A2", +"d. c #505050", +"e. c #737373", +"f. c #666666", +"g. c #646464", +"h. c #5A5A5A", +"i. c #B0B0B0", +"j. c #AEAEAE", +"k. c #272727", +"l. c #6A6A6A", +"m. c #ABABAB", +"n. c #ADADAD", +"o. c #262626", +"p. c #0F0F0F", +"q. c #141414", +"r. c #D5D5D5", +"s. c #525252", +"t. c #929292", +"u. c #C5C5C5", +"v. c #A0A0A0", +"w. c #CBCBCB", +"x. c #717171", +"y. c #9E9E9E", +"z. c #CDCDCD", +"A. c #2B2B2B", +"B. c #595959", +"C. c #161616", +"D. c #131313", +"E. c #6E6E6E", +"F. c #7E7E7E", +"G. c #B8B8B8", +"H. c #252525", +"I. c #2F2F2F", +"J. c #DCDCDC", +"K. c #484848", +"L. c #BFBFBF", +"M. c #B1B1B1", +"N. c #747474", +"O. c #434343", +"P. c #A5A5A5", +"Q. c #383838", +"R. c #989898", +"S. c #878787", +"T. c #222222", +"U. c #AAAAAA", +"V. c #D1D1D1", +"W. c #313131", +"X. c #636363", +"Y. c #909090", +"Z. c #9D9D9D", +"`. c #0D0D0D", +" + c #363636", +" . . . . . . . . ", +" . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . + @ # $ % & + . . . . . . . . ", +" . . . . . . . . . . . . . . . * = - ; ; > , ' . . . . . . . . . ", +" . . . . . . . . . . ) ! ~ { ] ^ / ; ; ( _ : < [ } | 1 2 3 4 . . . . ", +" . . . . . . . . . . 5 6 / 7 8 9 0 ; ; a | < + b c d ; ; ; e f ! . . . . ", +" . . . . . . . . . ] g h ; i j k l ; ; m % n 3 o ; ; ; ; ; ; ; ; p q . . . . ", +" . . . . . . . . . r s t u o v w o ; ; ; x y z A ; ; ; ; l B 7 C D E F . . . . . ", +" . . . . . . . . . G H u I J ] E I ; ; ; ; ; ; ; ; ; ; K L j . . . . . . . . . . ", +" . . . . . . . . . r M I u N } O P u ; ; ; ; ; ; ; ; ; ; I Q R S T T 6 b [ U . . . . ", +" . . . . . . . V W V X u u N Y h u u ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; Z ` ] . . . ", +" . . . . . . . ...+.w ; u u ; I u u u ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; l @.U . . . ", +" . . . . . . V #.$.] %.u u u u u u u u ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; &.[ . . . ", +" . . . . . . n ` d *.U =.u u u u u u u u ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; A # -.;.d ; ! . . . . ", +" . . . . . . >.,.; '.U q ; u u u u u u u ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ).!.. 4 ~.I {.. . . . ", +" . . . . . . } ; ; 0 ].# ; u u u u u u u ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ^./.(.(._.:.. . . . ", +" . . . . . . <.; ; ; [.}.u u u u u u u u ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; |.~.1.{ 8 . . . . ", +". . . . . . . 2.u u u u u u u u u u u u u u u > K e u u u u u u u u u u u u u u 3.4.. . . . . . ", +". . . . . . . 5.; ; ; u u u u u u u u u u ; 6.7.q D / ; ; ; ; ; ; ; ; ; ; ; ; ; ).8.. . . . . . ", +". . . . . . . 9.0.; ; u u u u u u u u u u a.b.. . r g ; ; ; ; ; ; ; ; ; ; ; ; ; ; c.!.. . . . . ", +"r . . . . W d.] e.> ; u u u u u u u u u ; f.. . . . g.; ; ; ; ; ; ; ; ; I ^.h ; ; - >.. . . . r ", +". . . . . h.i.) 8 , ; u u u u u u u u u I <.. . . ].j.; ; ; ; ; ; ; ; ; d k.l.; ; h v . . . . . ", +". . . . . m.e k j 4 6.u u u u u u u u u ; n.o.+ k.i I ; ; ; ; ; ; ; ; ; a 4.p.*.; }.q.. . . . . ", +". . . . . *.; r.s.n t.u u u u u u u u u u ; u.v.w.I ; ; ; ; ; ; ; ; ; ; e k r x.; ~.n . . . . . ", +" . . . . j.; ; d #.^.; u u u u u u u u u ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; y.8 8.z.A.. . . . . ", +" . . . . F ; ; ; ; ; u u u ; u u u u u u ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;.v B.| . . . . . . ", +" . . . . C.f ; ; ; ; u u u u u u u u u u ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; X * . . . . . . . . ", +" . . . . . A.'.> ; ; u u u u u u u u u u ; ; ; ; ; ; ; ; ; ; ; ; h |.; ; z.@ . . . . . . . . ", +" . . . . . D.E.c ).u u u u u u u u u u ; ; ; ; ; ; ; ; ; ; ; r.# #.; ; S < . . . . . . . ", +" . . . . < W j w : } #.u u u u u u u u ; ; ; ; ; ; ; ; ; ; d @.!.S ; ; F.. . . . . . . . ", +" . . . G G.E.H.U . I.K u u u u u u u ; ; ; ; ; ; ; ; ; ; J.K. .a.; h 4 . . . . . . . ", +" . . . ] B > / P Q &.e u u u u u u u ; ; ; ; ; ; ; ; ; ; L.p.} 0 K [.. . . . . . . . ", +" . . . g.I ; ; u u u u u u u u u u ; ; ; ; ; 0.J.; ; ; E . -.; b 8 . . . . . . . ", +" . . . V $ A ; u u u ; h M.N.Y Q ; ; ; ; H O.5 0.; ; $.v G P.=.n . . . . . . . . ", +" . . . . Q.l.3.'.R.^ %.D.r s H ; ; ; d 5.] S.I ; d J ] T.C.. . . . . . . . . ", +" . . . . . . . . r .D U.I u u ; V.7.U % ; ; I -.j . . . . . . . . . . . ", +" . . . . . 8 = m.;.|.u u u 0 B ! 8 B.X ; t i ) . . . . . . . . . . . ", +" . . . . . W.= |.u u ( U.X.+ k.Y.; J.Z.3 . . . . . . . . . . . . ", +" . . . . . `.G 5 +G b.. . q.5 5 : < . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . ", +" . . . . . . . . "}; diff --git a/src/fonts.c b/src/fonts.c index cbccda4a..f2eb03e7 100644 --- a/src/fonts.c +++ b/src/fonts.c @@ -457,8 +457,8 @@ pango_load (Lisp_Font *f) metrics = pango_font_get_metrics (font, language); - f->ascent = metrics->ascent / PANGO_SCALE; - f->descent = metrics->descent / PANGO_SCALE; + f->ascent = pango_font_metrics_get_ascent(metrics) / PANGO_SCALE; + f->descent = pango_font_metrics_get_descent(metrics) / PANGO_SCALE; pango_font_metrics_unref (metrics); diff --git a/src/windows.c b/src/windows.c index c1cf652f..44eed50d 100644 --- a/src/windows.c +++ b/src/windows.c @@ -80,6 +80,9 @@ DEFSYM(south_west, "south-west"); DEFSYM(south, "south"); DEFSYM(south_east, "south-east"); +/* for dockapp support */ +DEFSYM(mark_window_as_dockapp, "mark-window-as-dockapp"); + static repv gravity_map[StaticGravity+1]; /* In sawfish-1.3.3, the only callback used is keymap_prop_change. */ @@ -470,17 +473,28 @@ add_window (Window id) insert_in_stacking_list_above_all (w); restack_window (w); + w->wmhints = XGetWMHints (dpy, w->id); + if (w->wmhints && w->wmhints->flags & StateHint + && w->wmhints->initial_state == WithdrawnState + && w->wmhints->flags & IconWindowHint + && w->wmhints->icon_window != 0) { + /* window in withdrawn state with IconWindow? */ + /* This definitely looks like dockapp... */ + w->id = w->wmhints->icon_window; + w->wmhints = XGetWMHints (dpy, w->id); + rep_call_lisp1 (Fsymbol_value (Qmark_window_as_dockapp, Qt), w); + } + /* ..now do the X11 stuff */ - XSelectInput (dpy, id, CLIENT_EVENTS); - XGetWindowAttributes (dpy, id, &w->attr); + XSelectInput (dpy, w->id, CLIENT_EVENTS); + XGetWindowAttributes (dpy, w->id, &w->attr); DB((" orig: width=%d height=%d x=%d y=%d\n", w->attr.width, w->attr.height, w->attr.x, w->attr.y)); w->old_border_width = w->attr.border_width; get_window_name(w); - w->wmhints = XGetWMHints (dpy, id); if (!XGetWMNormalHints (dpy, w->id, &w->hints, &supplied)) w->hints.flags = 0; get_window_protocols (w); @@ -511,7 +525,7 @@ add_window (Window id) xwc.width = w->attr.width; xwc.height = w->attr.height; xwc.border_width = 0; - XConfigureWindow (dpy, id, xwcm, &xwc); + XConfigureWindow (dpy, w->id, xwcm, &xwc); w->visible = TRUE; w->mapped = TRUE; /* only called from map request */ @@ -1849,6 +1863,8 @@ windows_init (void) rep_INTERN(south); rep_INTERN(south_east); + rep_INTERN(mark_window_as_dockapp); + gravity_map[ForgetGravity] = Qforget; gravity_map[NorthWestGravity] = Qnorth_west; gravity_map[NorthGravity] = Qnorth;