Closed Ambrevar closed 4 years ago
That's strange. Might it have to do with your theme? Please, use M-x list-faces-display and have a look at the mouse
face, particularly the background. Note that under my experience the mouse
face uses to linger when you switch themes.
Other than that, I don't think EXWM meddles with the mouse cursor in any way.
I haven't configured the face of my mouse cursor. Here it is:
Face: mouse (sample) (customize this face)
Documentation: Basic face for the mouse color under X.
Defined in ‘faces.el’.
Family: unspecified
Foundry: unspecified
Width: unspecified
Height: unspecified
Weight: unspecified
Slant: unspecified
Foreground: unspecified
DistantForeground: unspecified Background: unspecified Underline: unspecified Overline: unspecified Strike-through: unspecified Box: unspecified Inverse: unspecified Stipple: unspecified Font: unspecified Fontset: unspecified Inherit: unspecified
Hm. I'm at a loss. I suggest you to try the following:
a) Change the Foreground
and Background
color of the mouse
face. Does the color change?
b) Have a look at the instructions in https://wiki.archlinux.org/index.php/Cursor_themes, (in particular https://wiki.archlinux.org/index.php/Cursor_themes#Change_X_shaped_default_cursor).
c) Try other simple tiling window manager (e.g., awesome mentioned in the above link). How is the cursor there?
I tried a few things:
Setting the foreground does nothing.
Setting the background changes the filling color of the pointer. I haven't found a way to set the contur.
xsetroot
changes nothing.
The pointer in LXappearance is Adwaita. In other GTK applications (e.g. IceCat) it's the default X cursor. In Emacs it seems to be the default X cursor but with a black contour instead of the white contour.
xrdb -query
has nothing mouse related.
For now I'll settle with
(set-face-background 'mouse "#777777")
in my Emacs configuration. That'll do, although I wish I could have changed the mouse contour color :/
@Ambrevar Is EXWM running on a GTK3 build of Emacs? You can check this with M-x emacs-version.
I tried with both Athena and GTK3: same thing.
Cursor is an attribute of X windows and fallback to use parent's when absent. If xsetroot
does not affect the cursor in Emacs frames then Emacs must have specified its own one. Perhaps you should try modifying the cursor theme before running any GUI apps (including Emacs).
That's what I had tried when I mentioned that xsetroot
changes nothing.
In fact, I have a dzen bar and when I move the mouse cursor there, it display properly (black with white contour).
On Emacs, it's all black.
Unfortunately there seems to be no way to check which cursor an X window is using. The only relevant code in EXWM that is involved in modifying cursor is moving/resizing an X window (just a temporary cursor set with the GrabPointer
request). The cursors are initialized when EXWM starts up so you can check if they are normal (by holding super and down-mouse-1 over a floating X window for example). If not then maybe something starts after EXWM modifies the cursor theme.
I seem to have the same issue. However, I only get a black cursor on higher exwm workspaces:
It looks like X11 settings are not initialized correctly when new workspaces are started. Hope this helps debugging the issue.
@mnick Do you have any special setting related to X cursor? Workspace frames are created with (make-frame)
and there's no option to control which X cursor to use for the new frame. For me I just make the cursor theme preconfigured and have xsetroot -cursor_name left_ptr
run before starting Emacs.
@mnick: Please,
(frame-parameter nil 'background-color)
(frame-parameter nil 'mouse-color)
(describe-face 'mouse)
post the value of the following variables:
initial-frame-alist
default-frame-alist
window-system-default-frame-alist
post the output of xrdb -query
.
Let me know if something's not clear or you find difficulties.
Unlike @mnick I only ever use one workspace, and the cursor is all black by default in workspace 0.
@Ambrevar, thanks for the info. Please, post the results I asked @mnick, in case it sheds some light.
One can get an all-black mouse pointer evaluating this snippet:
;; The `mouse-color` frame parameter determines the pointer foreground, the
;; `background-color` determines the pointer background. When those are the same,
;; the background color of the pointer is taken from `foreground-color`.
(let ((frame (make-frame '((background-color . "black")
(foreground-color . "black")
(mouse-color . "black")))))
;; Restore back/foreground.
(set-frame-parameter frame 'background-color "white")
(set-frame-parameter frame 'foreground-color "black"))
Does that ring a bell?
@Ambrevar, @mnick: Could you also have a look at your .emacs.d/custom.el
file? Do you use desktop.el
? If so, please also have a look there for anything relevant.
I don't use custom.el. I use desktop.el, but there is nothing regarding mouse-color or frame faces.
@Ambrevar, @mnick: is this still happening?
I didn't notice when it changed, but now that you mention it, you are right, the cursor is no longer all black for me!
Any idea what fixed it?
No clue :-). I'd say something in your environment (?).
I'm closing the ticket, please reopen if it happens again.
I don't remember if this always was an issue, but now I'm a little annoyed by the mouse cursor: it's all black (contour as well), so it's very hard to see on my black-backgrounded Emacs buffers.
Note as soon as the mouse hovers over X windows (i.e. not Emacs buffers) then the cursor becomes "normal", that is, black with a white contour.
If I start Emacs without EXWM, the mouse cursor is also normal.
I don't have any specific configuration regarding the mouse cursor.