! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Request: have zooming with Alt+[scroll wheel] also scale the mouse pointer/cu...
Status:
RESOLVED: FIXED

Comments

Description Pietro Gagliardi (andlabs) 2014-06-30 15:36:07 CEST
Right now, zooming in with xfwm4 with Alt+[scroll wheel] causes the cursor size to remain unchanged. I know that you can resize the cursor globally, but a better feature would be to scale the cursor along with the rest of the screen. This iwould make the zooming feature truly useful as an accessibility feature, as right now I would either have to have the cursor be very big at all zoom levels or squint to see what I'm clicking on. I'd need the zoom feature because Iam visually impaired, so this enhancement would really help. Thanks!
Comment 1 trash4inbox 2014-09-29 13:58:07 CEST
+500. We need necessarily this feature too. PLZ!!! Thank you.
Comment 2 Steve Dodier-Lazaro editbugs 2015-02-21 07:03:20 CET
Marking this report major as it seems the purpose of the zoom feature would be partially defeated without the suggested course of action (and a11y support is rather major :-) ).
Comment 3 Peter de Ridder editbugs 2015-03-20 20:42:06 CET
Created attachment 6102 
Scale the cursor

This is the patch file of the scale-cursor branch: http://git.xfce.org/users/peter/xfwm4/log/?h=scale-cursor
Comment 4 Olivier Fourdan editbugs 2015-03-21 17:00:05 CET
(In reply to Peter de Ridder from comment #3)
> Created attachment 6102 
> Scale the cursor
> 
> This is the patch file of the scale-cursor branch:
> http://git.xfce.org/users/peter/xfwm4/log/?h=scale-cursor

Thanks Peter, that's awesome!

A few comments:

In zoom_timeout_cb () you seem to call XFixesGetCursorImage() every time, even if the cursor hasn;t changed, that doesn't seem right.

The cursor should be kept and refreshed only when it actually changes.

The location can be retrieved from motionNotify events (you need to set up an event handler for that in the compositor).

+    for (y = 0; y < height; y++)
+    {
+        for (x = 0; x < width; x++)
+        {
+            guint32 argb = cursor->pixels[y * width + x];
+
+            c.alpha = ((argb >> 16) & 0xff00) | ((argb >> 24) & 0xff);
+            c.red   = ((argb >>  8) & 0xff00) | ((argb >> 16) & 0xff);
+            c.green = ((argb      ) & 0xff00) | ((argb >>  8) & 0xff);
+            c.blue  = ((argb <<  8) & 0xff00) | ((argb      ) & 0xff);
+
+            XRenderFillRectangle (display_info->dpy, PictOpSrc,
+                                  picture, &c, x, y, 1, 1);
+        }
+    }
+

Err, why? Why looping on height/width filling 1x1 rectangles?
Comment 5 Peter de Ridder editbugs 2015-03-22 22:27:45 CET
(In reply to Olivier Fourdan from comment #4)
> In zoom_timeout_cb () you seem to call XFixesGetCursorImage() every time,
> even if the cursor hasn;t changed, that doesn't seem right.

This can be done with cursor notification indeed.

> The cursor should be kept and refreshed only when it actually changes.

But, we had the timer loop already, which was querying the mouse location so I replace the function.

> The location can be retrieved from motionNotify events (you need to set up
> an event handler for that in the compositor).

That way we can drop the whole timer (I'm in favor). Does this work when any application takes a pointer grab?

> Err, why? Why looping on height/width filling 1x1 rectangles?

I hadn't found a way to load the image directly. I wanted to ask you, or anyone else, how to do that. The color information in an array of CARD32 with ARGB values.
Comment 6 trash4inbox 2015-03-23 11:21:25 CET
(In reply to Peter de Ridder from comment #3)
> Created attachment 6102 
> Scale the cursor
> 
> This is the patch file of the scale-cursor branch:
> http://git.xfce.org/users/peter/xfwm4/log/?h=scale-cursor

Wooooow! Wizard! It works within xfwm4-4.12.2. Great! Thank you very much.
Comment 7 Olivier Fourdan editbugs 2015-03-27 22:44:32 CET
pushed to git master along with some rework.

Bug #10988

Reported by:
Pietro Gagliardi (andlabs)
Reported on: 2014-06-30
Last modified on: 2015-03-27

People

Assignee:
Olivier Fourdan
CC List:
3 users

Version

Version:
unspecified

Attachments

Scale the cursor (9.09 KB, patch)
2015-03-20 20:42 CET , Peter de Ridder
no flags

Additional information