Results 1 to 7 of 7

Thread: How do I set the focus policy to focus follows mouse?

  1. #1
    Join Date
    Apr 2009
    Beans
    559

    How do I set the focus policy to focus follows mouse?

    I've been reading a guide and as a preamble it suggested that it would be easier for me to set the focus policy to “focus follows mouse”. The nearest I could find, in System>Preferances>Window Preferances, was to “select windows when the mouse moves over them”. It has partially worked yet when I click on a large window below a smaller, the active window moves to the top layer and hides anything below it. As I read that one can use this feature to do copy and paste actions I presume I've not set it correctly. Does anyone know how to do this in Ubuntu?

    The paragraph in blue at the end of the page is where I read that it can be done.

    http://linuxcommand.org/lts0010.php

  2. #2
    Join Date
    Apr 2009
    Beans
    1,343
    Distro
    Xubuntu

    Re: How do I set the focus policy to focus follows mouse?

    Yes, I have read this in the book "The Linux® Command Line" by William E. Shotts, Jr. also. I have googled it, and only found the suggestion to use System > Preferences > Windows > Window Selection and to check the box for: Select windows when the mouse moves over them. It does bring the respective windows into focus; but like you, I am at a loss, as how it is a help with the copy and paste procedure.

    Can anyone shed some light on how this function works.

    Thanks.

  3. #3
    Join Date
    Jul 2007
    Location
    Burlington, NC
    Beans
    1,995
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How do I set the focus policy to focus follows mouse?

    The behavior he describes appears to have changed over the years.

    To get the effect he's talking about, run the following command,
    either in the "Run" window (Alt+F2 by default) or in a terminal:
    Code:
    gconf-editor
    Then, in the tree pane on the left, navigate down to /apps/metacity/general
    and uncheck "raise_on_click" in the pane on the right.

    The one shot terminal command to change this setting would be:
    Code:
    gconftool-2 --set /apps/metacity/general/raise_on_click -t bool false

  4. #4
    Join Date
    Apr 2009
    Beans
    1,343
    Distro
    Xubuntu

    Smile Re: How do I set the focus policy to focus follows mouse?

    Quote Originally Posted by asmoore82 View Post
    The behavior he describes appears to have changed over the years.

    To get the effect he's talking about, run the following command,
    either in the "Run" window (Alt+F2 by default) or in a terminal:
    Code:
    gconf-editor
    Then, in the tree pane on the left, navigate down to /apps/metacity/general
    and uncheck "raise_on_click" in the pane on the right.

    The one shot terminal command to change this setting would be:
    Code:
    gconftool-2 --set /apps/metacity/general/raise_on_click -t bool false
    Thank you! I appreciate you explaining how to do this with both the navigation on the tree and the one shot terminal command. I certainly could have copied your one shot command and ran it, but if I didn't like the behaviour it produced, I would have only been guessing what to run in shell to undo the behaviour. This way I have a GUI way to be sure to reverse if I cannot figure how to it do by command.

    EDIT: By the way, The Linux® Command Line" by William E. Shotts, Jr. is about learning Bash in shell; I recommend it, for other newbies starting to learn Bash. It can be read online or downloaded to PDF here: http://gd.tuwien.ac.at/linuxcommand.org/tlcl.php

    Mike
    Last edited by mikodo; March 3rd, 2010 at 05:27 AM.

  5. #5
    Join Date
    Apr 2009
    Beans
    1,343
    Distro
    Xubuntu

    Re: How do I set the focus policy to focus follows mouse?

    I read this warning, when following the above first command, on Metacity the "raise on click". Maybe it is something to consider before using it:

    Setting this option to false can lead to buggy behavior, so users are strongly discouraged from changing it from the default of true. Many actions (e.g. clicking in the client area, moving or resizing the window) normally raise the window as a side-effect. Setting this option to false, which is strongly discouraged, will decouple raising from other user actions, and ignore raise requests generated by applications. See http://bugzilla.gnome.org/show_bug.cgi?id=445447#c6. Even when this option is false, windows can still be raised by an alt-left-click anywhere on the window, a normal click on the window decorations, or by special messages from pagers, such as activation requests from tasklist applets. This option is currently disabled in click-to-focus mode. Note that the list of ways to raise windows when raise_on_click is false does not include programmatic requests from applications to raise windows; such requests will be ignored regardless of the reason for the request. If you are an application developer and have a user complaining that your application does not work with this setting disabled, tell them it is _their_ fault for breaking their window manager and that they need to change this option back to true or live with the "bug" they requested.

    Mike
    Last edited by mikodo; March 3rd, 2010 at 06:02 PM.

  6. #6
    Join Date
    Mar 2010
    Location
    Rockville, Maryland
    Beans
    Hidden!

    Re: How do I set the focus policy to focus follows mouse?

    Hi, as the author of said advice, let me chime in here. In recent versions of GNOME, windows always raise when you click in them. You should leave this behavior alone as the warning message suggests. My book's recommendation about "focus follows mouse" comes from an earlier time when this was not the case. It used to be that you could middle click in a window and it did not raise. However, I continue to recommend "focus follows mouse" (which you set in Preferences->Windows) because it still makes typing into terminals easier. Overlap two terminal windows and you will see what I mean
    Last edited by William Shotts; March 3rd, 2010 at 03:45 PM.

  7. #7
    Join Date
    Apr 2009
    Beans
    559

    Re: How do I set the focus policy to focus follows mouse?

    Thanks asmoore82 for pm-ing me and bringing my attention back to this post. Also a huge thank you to William Shotts for an excellent guide. Informative and good technical copy writing which, in my experiance, is the most difficult writing genre of all. Perhaps someday when I've absorbed it all I'll be capable of throwing something back into the open source pool. I shall set the focus as you suggest.


    It's a shame when old features are compromised by new. However, since my original post I have replaced my very old low resolution crt monitor ( couldn't afford to really but my eyes insisted ) with a low end wide screen lcd so am less crowded and can put the guide on one side and terminals on the other so focus is less of an issue than it was. So thanks all round really.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •