fedops blog

Privacy in Computing

Tue 22 May 2018

Quick Tip - Working with Windows

Posted by fedops in Howto   

This is a matter of personal preference, so take it with a grain of salt. To an old X11 head, there are a few settings that help make a windowing environment more efficient. Two of those include automatic clipboard synchronisation, and focus-follows-mouse.

Automatic Clipboard Synchronisation

The way the original X Window System worked was that whatever content got marked by the user automatically ended up in the system-wide clipboard. This content was called the "primary selection" and the theory was that whenever something got marked it was to be able to transfer that content to another application. Which, as far as I'm concerned, is true. So why make the user actively call a copy command anyway? Just copy whatever was marked with the left mouse button into the buffer, and have it ready for the middle mouse button to paste it wherever it needs to go.

While not the default setting in Gnome (probably to not confuse users coming from that other Windows environment), it can easily be activated. Start the GPaste application, go into Preferences, and select the two items marked in red:

Primary selection sync

Now whenever you mark text, it will be ready to paste with the middle button.

Focus Follows Mouse

Another thing that I simply cannot live without is the focus-follows-mouse function, sometimes also called "sunmouse" for it was Sun Microsystems that popularized this setting. Essentially what it does is it focuses the window that the mouse rests over without requiring a click, and optionally without altering the stacking order of the windows displayed on screen. The advantage is it will allow the user to work with a large number of carefully arranged (typically terminal) windows in a very efficient manner.

Let's say you have a window in which you are editing code, and a second window in which you run the compiler to create an executable. Arrange the window so the code window is at the top, with only the bottom 4 or 5 lines of text of the compiler window visible. When you have saved a change to the code you nudge the mouse over the compiler window, type a compile command (or hit up-arrow, return), and watch the last few lines of output to scan for an error message. As long as you don't click into any of the windows, the stacking order will remain.

You can turn this function on in the Gnome Tweak tool. This isn't installed in Fedora by default, so start by installing it from the Software "store". Then run it, and make the settings like shown below:

Focus follows mouse setting

The "sloppy" part refers to keeping the last window focused when the mouse moves off a window onto the desktop background (called the root window), which cannot be focused. Without this set, no window would have the focus.

Give these settings a try and see if you like them.