Xfce Wiki

Sub domains
 

Site Tools

Translations of this page?:

Patches for the window Manager (xfwm4)

Note: I created this page to post some modifications (adjustments?) I have made to xfwm4. They are not major but they have really improved my own experience with Xfce.

Ability to resize windows by dragging the top of the frame

With xfwm4, you can resize windows by dragging either side of the frame (left or right), the bottom, or any corner, but you cannot resize by dragging the top. Dragging the whole titlebar always moves the window only. I wanted to be able to resize by dragging the top. In themes where the title bar stretches across the width of the window, dragging the title bar should move the window (existing behaviour) if you aim in the “body” of the title bar but resize it if you aim along a narrow strip at the top. This makes it consistent with how you can resize the window by dragging the narrow strips on all the other sides and corners. In themes where the title bar does not stretch across the width of the window, the same behaviour should result in the fraction of the top where the title bar appears, and the rest of the top side should work just like the other sides.

As suggested, the exact behaviour of this feature depends on the theme, so it means that some extra information has to be included in the theme to take advantage of it. Unfortunately, I only prepared the modifications for the theme I use: B5. The change has no effect if you use any theme that does not include the new additions.

HOWTO

  • Apply the patch to the xfwm4 version 4.4.1 source code, recompile, and reinstall.
  • Create 10 new pixmaps for the theme to go with the 5 title pixmaps (in active and inactive states):
    • title-1-active.xpmtitle-1-resize-active.xpm
    • title-1-inactive.xpmtitle-1-resize-inactive.xpm
    • title-2-active.xpmtitle-2-resize-active.xpm
    • title-2-inactive.xpmtitle-2-resize-inactive.xpm
    • title-3-active.xpmtitle-3-resize-active.xpm
    • title-3-inactive.xpmtitle-3-resize-inactive.xpm
    • title-4-active.xpmtitle-4-resize-active.xpm
    • title-5-inactive.xpmtitle-4-resize-inactive.xpm
    • title-5-active.xpmtitle-5-resize-active.xpm
    • title-5-inactive.xpmtitle-5-resize-inactive.xpm

The “resize” versions should have the same dimensions as the non-“resize” versions but only the part(s) of the titlebar that should trigger resizing should be masked in. For example (for most themes), the “resize” versions should have everything but a narrow strip at the top masked out.

The extra pixmaps I have created for the B5 theme are available as an archive or as indidivual files. Add these files to your theme directory (all existing files should be untouched).

–vandry (2007-05-28)

Button actions patch

In xfwm4, the actions associated with the mouse buttons are:

  • Button 1 on title: Raise the client. Move the window if dragged. Special action if double clicked.
  • Button 1 on edge: Raise and resize.
  • Button 2 on title: Lower the window.
  • Button 2 on edge: Move the window if dragged. Lower the window if clicked.
  • Button 3 on title: Move the window if dragged. Otherwise pop up the menu but only when the button is released!
  • Button 3 on edge: Resize the window.

I found these conventions to be quite confusing and inconsistent. For example: to move the window you have to use button 3 if you drag the title but button 2 instead if you drag another edge – or you can use button 1 but then the window will be unavoidably raised as a side effect. And the popup menu has just plain incorrect behaviour: it finally appears after you release the mouse button.

Unfortunately the mapping is not configurable, but I thought the following would be much better:

  • Button 1: DWIM (execute the most likely action)
    • If you drag the title bar: move
    • If you drag another part of the frame: resize
    • If you click only: raise window
  • Button 2 click: raise, or lower if already raised.
  • Button 2 drag: Move Window
  • Button 3 press: Popup menu (this is, after all, what Button 3 is used for in just about every application).

My proposed bindings will certainly not satisfy everyone any more than the default bindings suited me (in particular, I think many people do not care for the ability to easily move windows without raising them). That is why I would like to make the mouse bindings configurable. But for the moment I only wrote a patch to implement these bindings so I could comfortably use Xfce.

–vandry (2007-05-28)

xfwm4_changes.txt · Last modified: 2010/10/02 17:26 (external edit)