Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All black mouse cursor #513

Closed
Ambrevar opened this issue Nov 7, 2018 · 18 comments
Closed

All black mouse cursor #513

Ambrevar opened this issue Nov 7, 2018 · 18 comments

Comments

@Ambrevar
Copy link

Ambrevar commented Nov 7, 2018

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.

@medranocalvo
Copy link
Collaborator

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.

@Ambrevar
Copy link
Author

Ambrevar commented Nov 12, 2018 via email

@medranocalvo
Copy link
Collaborator

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?

@Ambrevar
Copy link
Author

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 :/

@ch11ng
Copy link
Owner

ch11ng commented Nov 18, 2018

@Ambrevar Is EXWM running on a GTK3 build of Emacs? You can check this with M-x emacs-version.

@Ambrevar
Copy link
Author

I tried with both Athena and GTK3: same thing.

@ch11ng
Copy link
Owner

ch11ng commented Nov 18, 2018

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).

@Ambrevar
Copy link
Author

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.

@ch11ng
Copy link
Owner

ch11ng commented Nov 25, 2018

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.

@mnick
Copy link

mnick commented Jul 21, 2019

I seem to have the same issue. However, I only get a black cursor on higher exwm workspaces:

  • On workspace 0 the cursor is fine
  • When I change to higher workspaces (e.g., 1-9), I get an all black cursor.
  • Within X Windows I get the correct cursor on all workspaces
  • Changing back to workspace 0 gives me the right cursor again

It looks like X11 settings are not initialized correctly when new workspaces are started. Hope this helps debugging the issue.

@ch11ng
Copy link
Owner

ch11ng commented Jul 21, 2019

@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.

@medranocalvo
Copy link
Collaborator

@mnick:
Please,

  1. post the result of evaluating each of the following within the first workspace and then within some higher workspace:
(frame-parameter nil 'background-color)
(frame-parameter nil 'mouse-color)
(describe-face 'mouse)
  1. post the value of the following variables:

    • initial-frame-alist
    • default-frame-alist
    • window-system-default-frame-alist
  2. post the output of xrdb -query.

Let me know if something's not clear or you find difficulties.

@Ambrevar
Copy link
Author

Ambrevar commented Jul 26, 2019 via email

@medranocalvo
Copy link
Collaborator

@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.

@Ambrevar
Copy link
Author

Ambrevar commented Jul 28, 2019 via email

@medranocalvo
Copy link
Collaborator

@Ambrevar, @mnick: is this still happening?

@Ambrevar
Copy link
Author

Ambrevar commented Mar 27, 2020 via email

@medranocalvo
Copy link
Collaborator

No clue :-). I'd say something in your environment (?).

I'm closing the ticket, please reopen if it happens again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants