# Does MouseCursor (const Image &image, int hotSpotX, int hotSpotY) work on Linux?

**URL:** <https://forum.juce.com/t/does-mousecursor-const-image-image-int-hotspotx-int-hotspoty-work-on-linux/27938>\
**Category:** Linux\
**Created:** [May 30, 2018, 9:20pm UTC](https://forum.juce.com/t/does-mousecursor-const-image-image-int-hotspotx-int-hotspoty-work-on-linux/27938 "2018-05-30T21:20:18Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![RolandMR](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rolandmr/32/641_2.png) [@RolandMR](https://forum.juce.com/u/RolandMR)\
**Post date:** [May 30, 2018, 9:20pm UTC](https://forum.juce.com/t/does-mousecursor-const-image-image-int-hotspotx-int-hotspoty-work-on-linux/27938/1 "2018-05-30T21:20:18Z")

</div>

Does MouseCursor (const Image &image, int hotSpotX, int hotSpotY) work on Linux? I can’t get it to work, the cursor doesn’t change. Stays with the previous cursor.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 31, 2018, 8:45am UTC](https://forum.juce.com/t/does-mousecursor-const-image-image-int-hotspotx-int-hotspoty-work-on-linux/27938/2 "2018-05-31T08:45:46Z")

</div>

It should do… certainly if you look in the code, the linux stuff uses custom mouse cursors internally so I guess it must at least have worked on some systems for us to have done that!

---

<div class="post-metadata">

**Author:** ![RolandMR](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rolandmr/32/641_2.png) [@RolandMR](https://forum.juce.com/u/RolandMR)\
**Post date:** [May 31, 2018, 4:53pm UTC](https://forum.juce.com/t/does-mousecursor-const-image-image-int-hotspotx-int-hotspoty-work-on-linux/27938/3 "2018-05-31T16:53:05Z")

</div>

I found the issue. I was creating my mouse cursors in a singleton that gets initialized early on. This works on Windows and Mac, but not Linux. Now I don’t create my mouse cursors until I need them for the first time and then cache them. This solves the issue.

---

<div class="post-metadata">

**Author:** ![codexchris](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@codexchris](https://forum.juce.com/u/codexchris)\
**Post date:** [April 30, 2019, 2:53pm UTC](https://forum.juce.com/t/does-mousecursor-const-image-image-int-hotspotx-int-hotspoty-work-on-linux/27938/4 "2019-04-30T14:53:09Z")

</div>

Hello all, we’ve encountered this issue too - creating MouseCursors too early on in Linux with Juce 5+ means we get blank or even the wrong image when using them. By creating the cursors on demand as per @RolandMR’s work around things are OK. Be nice if there was a fix but not essential.

Just sayin’…

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [April 30, 2019, 3:08pm UTC](https://forum.juce.com/t/does-mousecursor-const-image-image-int-hotspotx-int-hotspoty-work-on-linux/27938/5 "2019-04-30T15:08:50Z")

</div>

Ta Chris - @ed95 is up-to-the-elbow in linux stuff right now so maybe a good time for him to look into this one…

---

<div class="post-metadata">

**Author:** ![codexchris](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@codexchris](https://forum.juce.com/u/codexchris)\
**Post date:** [May 1, 2019, 12:00pm UTC](https://forum.juce.com/t/does-mousecursor-const-image-image-int-hotspotx-int-hotspoty-work-on-linux/27938/6 "2019-05-01T12:00:41Z")

</div>

Much obliged

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [May 2, 2019, 11:26am UTC](https://forum.juce.com/t/does-mousecursor-const-image-image-int-hotspotx-int-hotspoty-work-on-linux/27938/7 "2019-05-02T11:26:51Z")

</div>

Yep, I’ll take a look at this.

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [May 7, 2019, 4:32pm UTC](https://forum.juce.com/t/does-mousecursor-const-image-image-int-hotspotx-int-hotspoty-work-on-linux/27938/8 "2019-05-07T16:32:56Z")

</div>

Should be fixed here:

> <https://github.com/WeAreROLI/JUCE/commit/46a97e1f2c7d9564804f8bb9f88a17d837b5b0e0>

---

<div class="post-metadata">

**Author:** ![Toddler-Boy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/toddler-boy/32/2007_2.png) [@Toddler-Boy](https://forum.juce.com/u/Toddler-Boy)\
**Post date:** [May 7, 2019, 6:42pm UTC](https://forum.juce.com/t/does-mousecursor-const-image-image-int-hotspotx-int-hotspoty-work-on-linux/27938/9 "2019-05-07T18:42:34Z")

</div>

> [@jules](#):
>
> Ta Chris - @ed95 is up-to-the-elbow in linux stuff right now so maybe a good time for him to look into this one…

Stupid question, purely out of curiosity: why the sudden focus on Linux? Is there a specific reason?

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [May 8, 2019, 8:47am UTC](https://forum.juce.com/t/does-mousecursor-const-image-image-int-hotspotx-int-hotspoty-work-on-linux/27938/10 "2019-05-08T08:47:04Z")

</div>

We’ve been doing some work on adding VST3 support to Linux and as a result have been cleaning up bits of the code as we go.
