[Sawfish] Re: Patch Add toggle-fixed-size

[ Thread Index | Date Index | More lists.tuxfamily.org/sawfish Archives ]


On Fri, 29 Aug 2014 10:16:41 +0200
wrote fuchur <flohtransporter@xxxxxxxxx>:

>Patch for cabinet to make broken keybindings work. Add file
>heads.jl for multihead stuff. Add send-to-next-head and
>send-to-previous-head to sawfish.

Patches 01-fixed-size.patch and 02-fixed-size.patch

Add toggle-fixed-size to sawfish. Add keybindings for
toggle-fixed-size and add supported by cabinet and StyleTab lock-button.
Fix typo in fixed-position (fixed-postion).

Enable correct focus after you move tabbed windows (disable as i
build cabinet, forgotten).

Apply the patches after 01-cabinet-head.patch from this thread.


GPG Fingerprint: CA3B 8204 5B3E 6D48 6D53  C116 E5BC 70D5 B8D7 B2B0
diff -urNad sawfish.orgi/lisp/sawfish/wm/ext/cabinet.jl sawfish/lisp/sawfish/wm/ext/cabinet.jl
--- sawfish.orgi/lisp/sawfish/wm/ext/cabinet.jl
+++ sawfish/lisp/sawfish/wm/ext/cabinet.jl
@@ -269,7 +269,7 @@
                             maximize-window-fullscreen-toggle maximize-window-horizontally-toggle maximize-window-vertically-toggle maximize-window-fullxinerama-toggle
                             tab-add-maked-windows tab-release-window tab-move-to-end tab-move-to-beginning tab-move-to-right tab-move-to-left
                             move-window-to-center move-window-to-top-left move-window-to-next-workspace move-window-to-previous-workspace
-                            toggle-fixed-postion toggle-window-never-focus toggle-window-ignored toggle-task-list-skip toggle-window-cycle-skip
+                            toggle-fixed-position toggle-fixed-size toggle-window-never-focus toggle-window-ignored toggle-task-list-skip toggle-window-cycle-skip
                             toggle-window-list-skip toggle-desktop send-to-next-head send-to-previous-head
                             raise-window lower-window raise-window-depth lower-window-depth raise-lower-window
                             raise-window-and-transients raise-lower-window-and-transients delete-window-safely destroy-window
diff -urNad sawfish.orgi/lisp/sawfish/wm/keymaps.jl sawfish/lisp/sawfish/wm/keymaps.jl
--- sawfish.orgi/lisp/sawfish/wm/keymaps.jl
+++ sawfish/lisp/sawfish/wm/keymaps.jl
@@ -199,7 +199,8 @@
     :type keymap)
   (defcustom lock-button-keymap (bind-keys (make-keymap)
-					   "Button1-Off" 'toggle-fixed-postion)
+					   "Button1-Off" 'toggle-fixed-position
+					   "Button3-Off" 'toggle-fixed-size)
     "Keymap of \"lock\" button. Mouse-bindings only."
     :group bindings
     :type keymap)
diff -urNad sawfish.orgi/lisp/sawfish/wm/tabs/tabgroup.jl sawfish/lisp/sawfish/wm/tabs/tabgroup.jl
--- sawfish.orgi/lisp/sawfish/wm/tabs/tabgroup.jl
+++ sawfish/lisp/sawfish/wm/tabs/tabgroup.jl
@@ -219,7 +219,7 @@
     "Refresh the entire group containing WIN according to PROP.
 PROP can be one of the symbols: raise, frame, reframe, reframe-all, style, move,
 resize, title-position, type, depth, shade, unshade, iconify, uniconify, maximized,
-sticky, unsticky, fixed-position."
+sticky, unsticky, fixed-position fixed-size."
     (when tab-refresh-lock
       (setq tab-refresh-lock nil)
@@ -268,6 +268,10 @@
               (let ((group-frame-fixed-position (window-get win 'fixed-position)))
                 (mapcar (lambda (w)
                           (window-put w 'fixed-position group-frame-fixed-position)) unfocus)))
+             ((eq prop 'fixed-size)
+              (let ((group-frame-fixed-size (window-get win 'fixed-size)))
+                (mapcar (lambda (w)
+                          (window-put w 'fixed-size group-frame-fixed-size)) unfocus)))
              ((eq prop 'type)
               (let ((group-frame-type (window-get win 'type)))
                 (mapcar (lambda (w)
@@ -343,6 +347,7 @@
              (group-frame-gravity (window-get win 'gravity))
              (group-frame-never-iconify (window-get win 'never-iconify))
              (group-frame-fixed-position (window-get win 'fixed-position))
+             (group-frame-fixed-size (window-get win 'fixed-size))
              (group-frame-title-position (window-get win 'title-position))
              (group-frame-depth (window-get win 'depth))
              (group-frame-never-maximize (window-get win 'never-maximize))
@@ -378,6 +383,7 @@
           (window-put w 'never-iconify group-frame-never-iconify)
           (window-put w 'depth group-frame-depth)
           (window-put w 'fixed-position group-frame-fixed-position)
+          (window-put w 'fixed-size group-frame-fixed-size)
           (window-put w 'never-maximize group-frame-never-maximize)
           (window-put w 'maximized-vertically group-frame-maximized-vertically)
           (window-put w 'maximized-horizontally group-frame-maximized-horizontally)
@@ -582,13 +588,13 @@
                     (window-put w 'never-iconify t))
                   (window-put w 'tabbed t)) wins)
         (call-hook 'tab-group-windows-hook (list (tab-group-windows win)))
-        ;;(raise-window win)
+        (raise-window win)
         (setq all-wins nil))
       (setq tab-refresh-lock t)
       (when (window-tabbed-p win)
         (tab-refresh-group win 'move)
         (tab-refresh-group win 'frame)
-        ;;(set-input-focus (nth 0 (tab-group-windows-stacking-order win)))
+        (set-input-focus (nth 0 (tab-group-windows-stacking-order win)))
         (when clicked-frame
           (move-cursor-in-tabbar (input-focus))
           (setq clicked-frame nil)))
@@ -693,6 +699,9 @@
                         ((eq 'fixed-position args)
                          (tab-refresh-group win 'fixed-position)
                          (tab-refresh-group win 'frame))
+                        ((eq 'fixed-size args)
+                         (tab-refresh-group win 'fixed-size)
+                         (tab-refresh-group win 'frame))
                         ((eq 'frame-style args)
                          (tab-refresh-group win 'style)
                          (tab-refresh-group win 'reframe-all)
diff -urNad sawfish.orgi/lisp/sawfish/wm/windows.jl sawfish/lisp/sawfish/wm/windows.jl
--- sawfish.orgi/lisp/sawfish/wm/windows.jl
+++ sawfish/lisp/sawfish/wm/windows.jl
@@ -67,7 +67,8 @@
-	     toggle-fixed-postion))
+	     toggle-fixed-position
+         toggle-fixed-size))
     (open rep
@@ -633,13 +634,21 @@
   (define (window-height w)
     (cdr (window-frame-dimensions w)))
-  (define (toggle-fixed-postion w)
+  (define (toggle-fixed-position w)
     "Toggle the window property `fixed-position'."
      (if (window-get w 'fixed-position)
 	 (window-put w 'fixed-position nil)
        (window-put w 'fixed-position t))
      (call-window-hook 'window-state-change-hook w (list '(fixed-position))))
-  (define-command 'toggle-fixed-postion toggle-fixed-postion #:spec "%W")
+  (define-command 'toggle-fixed-position toggle-fixed-position #:spec "%W")
+  (define (toggle-fixed-size w)
+    "Toggle the window property `fixed-size'."
+     (if (window-get w 'fixed-size)
+	 (window-put w 'fixed-size nil)
+       (window-put w 'fixed-size t))
+     (call-window-hook 'window-state-change-hook w (list '(fixed-size))))
+  (define-command 'toggle-fixed-size toggle-fixed-size #:spec "%W")
 ;;; gaollable functions
   (gaol-add window-really-wants-input-p window-class window-avoided-p
diff -urNad sawfish.orgi/po/de.po sawfish/po/de.po
--- sawfish.orgi/po/de.po
+++ sawfish/po/de.po
@@ -4695,13 +4695,21 @@
 msgstr "Fenster umbenennen."
 #. ../lisp/sawfish/wm/windows.jl
-msgid "Toggle fixed postion"
+msgid "Toggle fixed position"
 msgstr "Fenster »Feste Position« an/aus"
 #. ../lisp/sawfish/wm/windows.jl
 msgid "Toggle the window property `fixed-position'."
 msgstr "Fenstereigenschaft feste Position ein-/ausschalten."
+#. ../lisp/sawfish/wm/windows.jl
+msgid "Toggle fixed size"
+msgstr "Fenster »Feste Grö�e« an/aus"
+#. ../lisp/sawfish/wm/windows.jl
+msgid "Toggle the window property `fixed-size'."
+msgstr "Fenstereigenschaft feste Grö�e ein-/ausschalten."
 #. ../lisp/sawfish/wm/ext/match-window.jl
 #. ../lisp/sawfish/wm/viewport.jl
 msgid "Viewport"
@@ -6055,6 +6063,14 @@
 msgstr "Cabinet"
 #. ../lisp/sawfish/wm/ext/cabinet.jl
+msgid "cabinet-switch"
+msgstr "Cabinet »Ausführen«"
+#. ../lisp/sawfish/wm/ext/cabinet.jl
+msgid "Start cabinet switch."
+msgstr "Cabinet aufrufen."
+#. ../lisp/sawfish/wm/ext/cabinet.jl
 msgid "Keybindings"
 msgstr "Tastenkombinationen"
@@ -6268,10 +6284,14 @@
 msgstr "Fenster auf Xinerama Vollbild »Maximieren« ein/aus"
 #. ../lisp/sawfish/wm/ext/cabinet.jl
-msgid "toggle-fixed-postion"
+msgid "toggle-fixed-position"
 msgstr "Fenster »Feste Position« an/aus"
 #. ../lisp/sawfish/wm/ext/cabinet.jl
+msgid "toggle-fixed-size"
+msgstr "Fenster »Feste Grö�e« an/aus"
+#. ../lisp/sawfish/wm/ext/cabinet.jl
 msgid "toggle-window-never-focus"
 msgstr "Fenster »Nie fokussieren« ein/aus"
diff -urNad sawfish.orgi/themes/StyleTab/theme.jl sawfish/themes/StyleTab/theme.jl
--- sawfish.orgi/themes/StyleTab/theme.jl
+++ sawfish/themes/StyleTab/theme.jl
@@ -2179,7 +2179,8 @@
 (define top-frame-lock-button
   `((class . lock-button)
     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"top-frame-button")))
-    (foreground . ,(lambda (w) (if (window-get w 'fixed-position)
+    (foreground . ,(lambda (w) (if (or (window-get w 'fixed-position)
+                                       (window-get w 'fixed-size))
                                    (table-ref styletab-c-frame-cache '"top-frame-unlock-button")
                                  (table-ref styletab-c-frame-cache '"top-frame-lock-button"))))
     (cursor . hand2)
@@ -2190,7 +2191,8 @@
 (define bottom-frame-lock-button
   `((class . lock-button)
     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"bottom-frame-button")))
-    (foreground . ,(lambda (w) (if (window-get w 'fixed-position)
+    (foreground . ,(lambda (w) (if (or (window-get w 'fixed-position)
+                                       (window-get w 'fixed-size))
                                    (table-ref styletab-c-frame-cache '"bottom-frame-unlock-button")
                                  (table-ref styletab-c-frame-cache '"bottom-frame-lock-button"))))
     (cursor . hand2)
@@ -2201,7 +2203,8 @@
 (define left-frame-lock-button
   `((class . lock-button)
     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"left-frame-button")))
-    (foreground . ,(lambda (w) (if (window-get w 'fixed-position)
+    (foreground . ,(lambda (w) (if (or (window-get w 'fixed-position)
+                                       (window-get w 'fixed-size))
                                    (table-ref styletab-c-frame-cache '"left-frame-unlock-button")
                                  (table-ref styletab-c-frame-cache '"left-frame-lock-button"))))
     (cursor . hand2)
@@ -2212,7 +2215,8 @@
 (define right-frame-lock-button
   `((class . lock-button)
     (background . ,(lambda (w) (table-ref styletab-c-frame-cache '"right-frame-button")))
-    (foreground . ,(lambda (w) (if (window-get w 'fixed-position)
+    (foreground . ,(lambda (w) (if (or (window-get w 'fixed-position)
+                                       (window-get w 'fixed-size))
                                    (table-ref styletab-c-frame-cache '"right-frame-unlock-button")
                                  (table-ref styletab-c-frame-cache '"right-frame-lock-button"))))
     (cursor . hand2)
@@ -2947,7 +2951,7 @@
 (call-after-state-changed '(tab-theme-name) frame-style-name)
 (call-after-state-changed '(tab-theme-tabbars) frame-style-tabbars)
 (call-after-state-changed '(marked) reframe-marked)
-(call-after-state-changed '(maximized sticky fixed-position stacking) reframe-one)
+(call-after-state-changed '(maximized sticky fixed-position fixed-size stacking) reframe-one)
 (add-hook 'remove-from-workspace-hook reframe-one)
 (custom-set-property 'styletab-c:styles ':after-set reload-frame-style-reframe)

Attachment: signature.asc
Description: PGP signature

Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/