[PATCH] XMonad: set the default root cursor to XC_left_ptr

I've noticed that the default root cursor isn't changed from X's default. Is
there a reason for this, other than just no one noticing because their display
manager overrides it? I've noticed this with nodm. The patch below changes
xmonad to override the default cursor.
From 90fcde3dc0fbe47aa9cc046315d0ee05c311e2bd Mon Sep 17 00:00:00 2001
From: Andres Salomon

Quoting Andres Salomon
+ -- set the default cursor to XC_left_ptr (which is 68 in X11/cursorfont.h) + setDefaultCursor dpy rootw 68
If there is no named constant for the left pointer in the X11 library, there should be. Using the constant 68 just reeks. ~d

On Sun, 13 Sep 2009 23:45:55 -0400 wagnerdm@seas.upenn.edu wrote:
Quoting Andres Salomon
: + -- set the default cursor to XC_left_ptr (which is 68 in X11/cursorfont.h) + setDefaultCursor dpy rootw 68
If there is no named constant for the left pointer in the X11 library, there should be. Using the constant 68 just reeks. ~d
I certainly agree.

On Sun, Sep 13, 2009 at 11:01:39PM -0400, Andres Salomon wrote:
I've noticed that the default root cursor isn't changed from X's default. Is there a reason for this, other than just no one noticing because their display manager overrides it? I've noticed this with nodm. The patch below changes xmonad to override the default cursor.
You can always set the cursor from your .xsession or .xinitrc using xsetroot(1) before starting xmonad (or any other window manager). Ciao, Kili

On Mon, 14 Sep 2009 20:38:46 +0200
Matthias Kilian
On Sun, Sep 13, 2009 at 11:01:39PM -0400, Andres Salomon wrote:
I've noticed that the default root cursor isn't changed from X's default. Is there a reason for this, other than just no one noticing because their display manager overrides it? I've noticed this with nodm. The patch below changes xmonad to override the default cursor.
You can always set the cursor from your .xsession or .xinitrc using xsetroot(1) before starting xmonad (or any other window manager).
Yep, and some display managers also set it. However, my opinion is that xmonad should be setting it. If people feel differently, I'd like to hear why.

Andres Salomon wrote:
On Mon, 14 Sep 2009 20:38:46 +0200 Matthias Kilian
wrote: On Sun, Sep 13, 2009 at 11:01:39PM -0400, Andres Salomon wrote:
I've noticed that the default root cursor isn't changed from X's default. Is there a reason for this, other than just no one noticing because their display manager overrides it? I've noticed this with nodm. The patch below changes xmonad to override the default cursor.
You can always set the cursor from your .xsession or .xinitrc using xsetroot(1) before starting xmonad (or any other window manager).
Yep, and some display managers also set it. However, my opinion is that xmonad should be setting it. If people feel differently, I'd like to hear why.
I always have this trinity in my head: X-Server, Window-Manager, Desktop-Environment. We're working on the level of the Window-Manager. But mouse pointers, fonts, window-decorations, etc., I always think of these as being the job of the Desktop-Environment -- not the window-manager's job. But I know that different people have different opinions.. Best, Thomas

On Mon, 14 Sep 2009 15:05:53 -0400
Thomas Friedrich
Andres Salomon wrote:
On Mon, 14 Sep 2009 20:38:46 +0200 Matthias Kilian
wrote: On Sun, Sep 13, 2009 at 11:01:39PM -0400, Andres Salomon wrote:
I've noticed that the default root cursor isn't changed from X's default. Is there a reason for this, other than just no one noticing because their display manager overrides it? I've noticed this with nodm. The patch below changes xmonad to override the default cursor.
You can always set the cursor from your .xsession or .xinitrc using xsetroot(1) before starting xmonad (or any other window manager).
Yep, and some display managers also set it. However, my opinion is that xmonad should be setting it. If people feel differently, I'd like to hear why.
I always have this trinity in my head: X-Server, Window-Manager, Desktop-Environment. We're working on the level of the Window-Manager. But mouse pointers, fonts, window-decorations, etc., I always think of these as being the job of the Desktop-Environment -- not the window-manager's job. But I know that different people have different opinions..
But what happens when you're not using a DE? :)

On Mon, 14 Sep 2009 15:47:35 -0400
Andres Salomon
... But what happens when you're not using a DE? :)
Nothing bad :) I don't use DE either, and set everything in ~/.xinitrc. Well, for beginners, of course, it's kind of disappointing, when they see only that default cross in the middle of the screen. But I think that people who want use xmonad should be pretty experienced in such things. Cheers, Sergey

Andres Salomon wrote:
On Mon, 14 Sep 2009 15:05:53 -0400 Thomas Friedrich
wrote: Andres Salomon wrote:
On Mon, 14 Sep 2009 20:38:46 +0200 Matthias Kilian
wrote: On Sun, Sep 13, 2009 at 11:01:39PM -0400, Andres Salomon wrote:
I've noticed that the default root cursor isn't changed from X's default. Is there a reason for this, other than just no one noticing because their display manager overrides it? I've noticed this with nodm. The patch below changes xmonad to override the default cursor.
You can always set the cursor from your .xsession or .xinitrc using xsetroot(1) before starting xmonad (or any other window manager).
Yep, and some display managers also set it. However, my opinion is that xmonad should be setting it. If people feel differently, I'd like to hear why.
I always have this trinity in my head: X-Server, Window-Manager, Desktop-Environment. We're working on the level of the Window-Manager. But mouse pointers, fonts, window-decorations, etc., I always think of these as being the job of the Desktop-Environment -- not the window-manager's job. But I know that different people have different opinions..
But what happens when you're not using a DE? :)
Well, in fact, I *don't* use a DE, and I set it via my .xinitrc. I so knew this gonna be a hot topic. Deeply philosophical, emotional, extreme in its oppositions ... ;)

On Mon, Sep 14, 2009 at 02:55:20PM -0400, Andres Salomon wrote:
You can always set the cursor from your .xsession or .xinitrc using xsetroot(1) before starting xmonad (or any other window manager).
Yep, and some display managers also set it. However, my opinion is that xmonad should be setting it. If people feel differently, I'd like to hear why.
Well, because you can set it elsewhere, and some people may want to use another cursor. The natural way to do so is to configure your X startup scripts, because it's WM independent. Why add code to xmonad when it's not necessary? Personally, I'm sometimes playing with and comparing different WMs (stuff like xmonad, scrotwm, ratpoison), and I'm *used* to get the cursor I like without tweaking the WM configuration first. Ciao, Kili

On Mon, 14 Sep 2009 21:07:19 +0200
Matthias Kilian
On Mon, Sep 14, 2009 at 02:55:20PM -0400, Andres Salomon wrote:
You can always set the cursor from your .xsession or .xinitrc using xsetroot(1) before starting xmonad (or any other window manager).
Yep, and some display managers also set it. However, my opinion is that xmonad should be setting it. If people feel differently, I'd like to hear why.
Well, because you can set it elsewhere, and some people may want to use another cursor. The natural way to do so is to configure your X startup scripts, because it's WM independent.
I'm not sure what you mean here. Are people really setting cursors via xsetroot, and feel strongly about it? Is setting a string in your .xinitrc really what people consider "the natural way" to configure pointers (versus a GUI app like gnome-appearance-properties)? I should point out that in a lot of instances, it's not even clear where such a thing would be set. For example, while 'startx' on my debian system allows me to run xsetroot via ~/.xinitrc, 'nodm' completely ignores .xinitrc (making cursor override documentation such as the stuff at http://wiki.archlinux.org/index.php/Xmonad pretty useless). If your argument is that the cursor should be allowed to be overridden, I believe you. In the case of the desktop environment, it can override the cursor as it normally does. In the case of no desktop environment, where you might want to override the cursor, I would think that being able to do so via xmonad would be a _lot_ more useful versus having to figure out which particular X init script you should be modifying or creating. I can certainly change the code to allow users to override the cursor via ~/.xmonad/xmonad.hs, for example.
Why add code to xmonad when it's not necessary?
Because it provides a default. It's not a large amount of code at all, and it's pretty clear what it's doing. Why make the unnecessary call out to xsetroot at X start time when it can easily be handled within XMonad via 4 lines of code?
Personally, I'm sometimes playing with and comparing different WMs (stuff like xmonad, scrotwm, ratpoison), and I'm *used* to get the cursor I like without tweaking the WM configuration first.
That's fine, but I could also point out window managers that override the cursor (ion3 and metacity, for example). You're not guaranteed that the window manager won't override the default cursor.

Hi, Am Montag, den 14.09.2009, 16:06 -0400 schrieb Andres Salomon:
I'm not sure what you mean here. Are people really setting cursors via xsetroot, and feel strongly about it? Is setting a string in your .xinitrc really what people consider "the natural way" to configure pointers (versus a GUI app like gnome-appearance-properties)? I should point out that in a lot of instances, it's not even clear where such a thing would be set. For example, while 'startx' on my debian system allows me to run xsetroot via ~/.xinitrc, 'nodm' completely ignores .xinitrc (making cursor override documentation such as the stuff at http://wiki.archlinux.org/index.php/Xmonad pretty useless).
Sessions under nodm can be configured in ~/.xsession, which replace your DE. You can of course source .xinitrc from there. (This does not imply an opinion about the OP’s patch, I don’t have one there :-)) Greetings, Joachim -- Joachim "nomeata" Breitner mail: mail@joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C JID: nomeata@joachim-breitner.de | http://www.joachim-breitner.de/ Debian Developer: nomeata@debian.org

On Mon, 14 Sep 2009 20:29:35 +0000
Joachim Breitner
Hi,
Am Montag, den 14.09.2009, 16:06 -0400 schrieb Andres Salomon:
I'm not sure what you mean here. Are people really setting cursors via xsetroot, and feel strongly about it? Is setting a string in your .xinitrc really what people consider "the natural way" to configure pointers (versus a GUI app like gnome-appearance-properties)? I should point out that in a lot of instances, it's not even clear where such a thing would be set. For example, while 'startx' on my debian system allows me to run xsetroot via ~/.xinitrc, 'nodm' completely ignores .xinitrc (making cursor override documentation such as the stuff at http://wiki.archlinux.org/index.php/Xmonad pretty useless).
Sessions under nodm can be configured in ~/.xsession, which replace your DE. You can of course source .xinitrc from there.
Oh? I haven't been able to get that to work; it just causes nodm to keep restarting X, with .xsession-errors reporting "X session started for dilinger at $timestamp". Note that I also opened up a bug against nodm for not setting the default cursor.. I can certainly supply a patch for that as well. ;) http://bugs.debian.org/546387
(This does not imply an opinion about the OP’s patch, I don’t have one there :-))
Greetings, Joachim

On Mon, Sep 14, 2009 at 04:52:46PM -0400, Andres Salomon wrote:
Note that I also opened up a bug against nodm for not setting the default cursor.. I can certainly supply a patch for that as well. ;)
And it's not even the job of the display manager to set the cursor. -- For some reason some communities are using the uptime of a machine as a compensation for something else being small. -- Artur Grabowski (http://www.blahonga.org/~art/diffs/)

On Mon, 14 Sep 2009 23:05:12 +0200
Matthias Kilian
On Mon, Sep 14, 2009 at 04:52:46PM -0400, Andres Salomon wrote:
Note that I also opened up a bug against nodm for not setting the default cursor.. I can certainly supply a patch for that as well. ;)
And it's not even the job of the display manager to set the cursor.
I never claimed it was; read the bug.

On Mon, Sep 14, 2009 at 04:06:53PM -0400, Andres Salomon wrote:
Well, because you can set it elsewhere, and some people may want to use another cursor. The natural way to do so is to configure your X startup scripts, because it's WM independent.
I'm not sure what you mean here. Are people really setting cursors via xsetroot, and feel strongly about it? Is setting a string in your .xinitrc really what people consider "the natural way" to configure pointers (versus a GUI app like gnome-appearance-properties)?
If i need a GUI to configure my GUI, something is seriously broken. Heck, do people using xmonad (or ratpoison, or scrotwm, or whatever tiling and keyboard-driven window manager) really care about the mouse cursor at all? Or do they fear editing some stupid ~/.xinitrc or ~/.xsession?
Why add code to xmonad when it's not necessary?
Because it provides a default.
X11 provides a default (the ugly cross shaped cursor). Overriding this in your ~/.xsession and/or ~/.xinitrc is a way to get a fancier cursor regardless of whatever window manager you're using. If your favor display manager sets another default cursor, blame your display manager.
It's not a large amount of code at all, and it's pretty clear what it's doing. Why make the unnecessary call out to xsetroot at X start time when it can easily be handled within XMonad via 4 lines of code?
It's adding code to xmonad that doesn't belong there.
Personally, I'm sometimes playing with and comparing different WMs (stuff like xmonad, scrotwm, ratpoison), and I'm *used* to get the cursor I like without tweaking the WM configuration first.
That's fine, but I could also point out window managers that override the cursor (ion3 and metacity, for example). You're not guaranteed that the window manager won't override the default cursor.
Then ion3 and metacity are doing it wrong. Ciao, Kili

On Mon, 14 Sep 2009 22:59:00 +0200
Matthias Kilian
On Mon, Sep 14, 2009 at 04:06:53PM -0400, Andres Salomon wrote:
Well, because you can set it elsewhere, and some people may want to use another cursor. The natural way to do so is to configure your X startup scripts, because it's WM independent.
I'm not sure what you mean here. Are people really setting cursors via xsetroot, and feel strongly about it? Is setting a string in your .xinitrc really what people consider "the natural way" to configure pointers (versus a GUI app like gnome-appearance-properties)?
If i need a GUI to configure my GUI, something is seriously broken.
No one said anything about *need*. But lots of people *want* a GUI to configure their GUI. Anyways, you didn't actually answer my question; do you *really* feel strongly about having your cursor a certain way, or is your primary objection "it's not the place of the window manager to set the cursor"?
Heck, do people using xmonad (or ratpoison, or scrotwm, or whatever tiling and keyboard-driven window manager) really care about the mouse cursor at all? Or do they fear editing some stupid ~/.xinitrc or ~/.xsession?
I really don't understand the resistance to setting the pointer. Is it absolutely critical to xmonad's functionality? Certainly not. However, what's the point of having people unnecessarily grovel around for documentation about their specific combination of DE + DM + distro + window manager, and edit the appropriate config file? Is the goal for xmonad to only be used by people who are systems programmers, systems administrators, and/or haskell hackers? Do you think that even for that class of user, having to poke around config files unnecessarily (where there's a sane default) is something that they enjoy?
Why add code to xmonad when it's not necessary?
Because it provides a default.
X11 provides a default (the ugly cross shaped cursor). Overriding this in your ~/.xsession and/or ~/.xinitrc is a way to get a fancier cursor regardless of whatever window manager you're using.
Hehe, "fancier"? Those post-1980's cursors sure are sexy!
If your favor display manager sets another default cursor, blame your display manager.
It's not a large amount of code at all, and it's pretty clear what it's doing. Why make the unnecessary call out to xsetroot at X start time when it can easily be handled within XMonad via 4 lines of code?
It's adding code to xmonad that doesn't belong there.
Personally, I'm sometimes playing with and comparing different WMs (stuff like xmonad, scrotwm, ratpoison), and I'm *used* to get the cursor I like without tweaking the WM configuration first.
That's fine, but I could also point out window managers that override the cursor (ion3 and metacity, for example). You're not guaranteed that the window manager won't override the default cursor.
Then ion3 and metacity are doing it wrong.
Sigh. Care to point me at the spec that states that the window manager MUST NOT set the default cursor?

2009/9/14 Andres Salomon
Sigh. Care to point me at the spec that states that the window manager MUST NOT set the default cursor?
The cursors are set by the XClient, because, as so many people fail to understand, they're a property of the XServer. Guess what a window manager is? Just another XClient. If you do something like: xsetroot -cursor foo That's setting it for the root-window -- which most WM's will be controlling anyway. If that's not set then it will use whatever the default one is set on the XServer, although most distros have a means to set this globally (c.f. in Debian with update-alternatives.) -- Thomas Adam

On Mon, Sep 14, 2009 at 05:19:41PM -0400, Andres Salomon wrote:
Anyways, you didn't actually answer my question; do you *really* feel strongly about having your cursor a certain way, or is your primary objection "it's not the place of the window manager to set the cursor"?
Neither. My primary objection is that adding code to some program for doing something that can be easily done elsewhere is wrong.

On Sun, Sep 13, 2009 at 11:01:39PM -0400, Andres Salomon wrote:
I've noticed that the default root cursor isn't changed from X's default. Is there a reason for this, other than just no one noticing because their display manager overrides it? I've noticed this with nodm. The patch below changes xmonad to override the default cursor.
While I understand the point of "just being a wm" and not a de, I like your idea. So I've set up a little startup hook which does exactly what you wanted to do without touching the core source of XMonad. Hope you like it. :) And sorry Andreas, my previous mail was supposed to go to the whole mailing list. ;)

On Tue, 15 Sep 2009 00:00:51 +0200
Nils
On Sun, Sep 13, 2009 at 11:01:39PM -0400, Andres Salomon wrote:
I've noticed that the default root cursor isn't changed from X's default. Is there a reason for this, other than just no one noticing because their display manager overrides it? I've noticed this with nodm. The patch below changes xmonad to override the default cursor.
While I understand the point of "just being a wm" and not a de, I like your idea. So I've set up a little startup hook which does exactly what you wanted to do without touching the core source of XMonad. Hope you like it. :)
And sorry Andreas, my previous mail was supposed to go to the whole mailing list. ;)
That's fine (and what I was getting at when I asked what people actually *wanted* when it came to configuring the cursor). But please, my first name has only 1 'A'. :) If such a mechanism makes it into xmonad, I'm happy to send patches to the haskell-x11 folks to export the cursor definitions as well.

On Tue, Sep 15, 2009 at 12:14:57AM +0200, Nils wrote:
On Mon, Sep 14, 2009 at 06:09:18PM -0400, Andres Salomon wrote:
But please, my first name has only 1 'A'. :)
Oh, hehe... I'm sure the dev who applies the patch can fix it? ;)
Actually, no. Darcs patch record messages can't be altered. If you want to change it, you'll need to 'darcs unrecord' them and make a new patch.

On Mon, Sep 14, 2009 at 10:00:01PM -0500, Spencer Janssen wrote:
Actually, no. Darcs patch record messages can't be altered. If you want to change it, you'll need to 'darcs unrecord' them and make a new patch.
Uh, okay. So here's the "new" version.

On Tue, Sep 15, 2009 at 12:16:49PM +0200, Nils wrote:
On Mon, Sep 14, 2009 at 10:00:01PM -0500, Spencer Janssen wrote:
Actually, no. Darcs patch record messages can't be altered. If you want to change it, you'll need to 'darcs unrecord' them and make a new patch.
Uh, okay. So here's the "new" version.
Tue Sep 15 12:13:27 CEST 2009 mail@n-sch.de * New module : X.H.SetCursor Idea from Andres Salomon (http://www.haskell.org/pipermail/xmonad/2009-September/008553.html).
Applied, thanks!

On Sat, 3 Oct 2009 20:08:51 +0200
Daniel Schoepe
On Tue, Sep 15, 2009 at 12:16:49PM +0200, Nils wrote:
On Mon, Sep 14, 2009 at 10:00:01PM -0500, Spencer Janssen wrote:
Actually, no. Darcs patch record messages can't be altered. If you want to change it, you'll need to 'darcs unrecord' them and make a new patch.
Uh, okay. So here's the "new" version.
Tue Sep 15 12:13:27 CEST 2009 mail@n-sch.de * New module : X.H.SetCursor Idea from Andres Salomon (http://www.haskell.org/pipermail/xmonad/2009-September/008553.html).
Applied, thanks!
Now that Don has merged the Cursor patches into haskell-x11, would you mind merging in my patches? Specifically: http://thread.gmane.org/gmane.comp.lang.haskell.xmonad/8348

On Tue, Sep 15, 2009 at 12:00:51AM +0200, Nils wrote:
While I understand the point of "just being a wm" and not a de, I like your idea. So I've set up a little startup hook which does exactly what you wanted to do without touching the core source of XMonad. Hope you like it. :)
In my opinion that would defeat the purpose of the original patch, since, being a contrib module, it would not be enabled by default. Therefore a user would still have to look at the documentation and figure out how to use that module, etc., which is at least as much effort as finding out that you can use xsetroot, which people coming from other minimal WMs already know.

On Sun, Sep 13, 2009 at 11:01:39PM -0400, Andres Salomon wrote:
I've noticed that the default root cursor isn't changed from X's default. Is there a reason for this, other than just no one noticing because their display manager overrides it? I've noticed this with nodm. The patch below changes xmonad to override the default cursor.
I'm going to quote part of the FAQ and the homepage: 1 When I start xmonad, nothing happens. Don't panic, this is expected behavior. XMonad is a minimal window manager, meaning it doesn't set a background, start a status bar, display a splash screen or play a soothing sound effect when it starts up. Once xmonad has started, the only thing it does is listen for your first command. -- xmonad is minimal. out of the box, no window decorations, no status bar, no icon dock. just clean lines and efficiency. In the default configuration, xmonad should do the minimum to be a useful window manager and have the essence of xmonad: WM keybindings, keybindings to launch other programs and the defining element of tiling layout algorithms. This principle is a mixture of the Unix philosophy, minimalism, and an effort to cater to power users that generally want tools that stay out of their way. I think this patch very slightly infringes on each part of that principle. Since it should be fairly easy for our target audience to set their pointer by other means, it seems that the benefit of staying minimal outweighs the benefits of the patch. While the vision for xmonad's core is to be minimal, contrib is meant to be chock full of any feature we can get our hands on. A module for contrib to set the mouse pointer from startupHook would be very appreciated! Cheers, Spencer Janssen

spencerjanssen:
On Sun, Sep 13, 2009 at 11:01:39PM -0400, Andres Salomon wrote:
I've noticed that the default root cursor isn't changed from X's default. Is there a reason for this, other than just no one noticing because their display manager overrides it? I've noticed this with nodm. The patch below changes xmonad to override the default cursor.
I'm going to quote part of the FAQ and the homepage:
1 When I start xmonad, nothing happens.
Don't panic, this is expected behavior. XMonad is a minimal window manager, meaning it doesn't set a background, start a status bar, display a splash screen or play a soothing sound effect when it starts up. Once xmonad has started, the only thing it does is listen for your first command.
--
xmonad is minimal. out of the box, no window decorations, no status bar, no icon dock. just clean lines and efficiency.
In the default configuration, xmonad should do the minimum to be a useful window manager and have the essence of xmonad: WM keybindings, keybindings to launch other programs and the defining element of tiling layout algorithms. This principle is a mixture of the Unix philosophy, minimalism, and an effort to cater to power users that generally want tools that stay out of their way.
I think this patch very slightly infringes on each part of that principle. Since it should be fairly easy for our target audience to set their pointer by other means, it seems that the benefit of staying minimal outweighs the benefits of the patch.
While the vision for xmonad's core is to be minimal, contrib is meant to be chock full of any feature we can get our hands on. A module for contrib to set the mouse pointer from startupHook would be very appreciated!
I think this is an excellent summary of the xmonad philosophy. It has perhaps never been stated as clearly, but throughout the design and implementation of the last 3 years, these principles were in mind. Setting the mouse cursor, and all that entails, should be a contrib module. -- Don P.S. bluetile should be a contrib module.
participants (11)
-
Andres Salomon
-
Daniel Schoepe
-
Don Stewart
-
Joachim Breitner
-
Matthias Kilian
-
Nils
-
Sergey Manucharian
-
Spencer Janssen
-
Thomas Adam
-
Thomas Friedrich
-
wagnerdm@seas.upenn.edu