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

xterm's empty cursor does not show on win32 #734

Closed
totaam opened this issue Nov 9, 2014 · 10 comments
Closed

xterm's empty cursor does not show on win32 #734

totaam opened this issue Nov 9, 2014 · 10 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Nov 9, 2014

Issue migrated from trac ticket # 734

component: platforms | priority: major | resolution: fixed | keywords: win32

2014-11-09 09:22:57: totaam created the issue


All the cursor tests seem to pass and look fine (custom cursor, all cursors) but the cursor used by xterm when you hit one of the modifier keys (at least for shift, control and alt) which is a completely empty one of size 6x13 (the size of one character on the default xterm) 312 bytes of rgb data, shows up late (only shows when you move the mouse, at which point the xterm resets it) and it looks different from what it should be..

I managed to capture a screenshot of it by delaying the sending of cursors in ServerSource.send_cursor by 5 seconds, then hitting one of the special modifier keys, waiting 5 seconds, seeing the cursor log message on the client then moving the mouse and asking gimp to take a screen capture! Here it is:
[[Image(win32-funny-cursor.png)]]

I think this ticket is important because I have also seen crashes in the cursor code on win32 with the GTK3 port (#640).

@totaam
Copy link
Collaborator Author

totaam commented Nov 9, 2014

2014-11-09 09:35:00: totaam uploaded file win32-funny-cursor.png (45.8 KiB)

screenshot of the funny cursor displayed on win32
win32-funny-cursor.png

@totaam
Copy link
Collaborator Author

totaam commented Nov 9, 2014

2014-11-09 09:39:18: totaam changed status from new to assigned

@totaam
Copy link
Collaborator Author

totaam commented Nov 9, 2014

2014-11-09 09:39:18: totaam changed owner from antoine to totaam

@totaam
Copy link
Collaborator Author

totaam commented Nov 9, 2014

2014-11-09 09:39:18: totaam edited the issue description

@totaam
Copy link
Collaborator Author

totaam commented Nov 9, 2014

2014-11-09 10:32:49: totaam edited the issue description

@totaam
Copy link
Collaborator Author

totaam commented Nov 9, 2014

2014-11-09 10:32:49: totaam commented


Adding this code to send_cursor:

if len(cpixels)==312:
    import binascii
    cursorlog.info("cursor data=%s", binascii.hexlify(cpixels))

I can verify that the cursor data being sent consists of 312 bytes null bytes. Both for Linux clients and win32...

So r8089 adds this same empty cursor to the custom cursor test code to make it easier to test, and we can see that the cursor is only applied when the mouse is moved (a GTK or win32 bug - not sure which, not sure there's much we can do about that).

Eventually found that we must provide fixed sized cursor pixel data on win32. GTK should really shield us from this sort of (annoying) details rather than giving us broken cursors!

So r8090 scales it to the exact size the OS wants - which is slightly problematic for cursors that are not square, like the one from the xterm: we scale 13x6 to 32x32 (and maybe 64x64 or other on high dpi displays apparently). Maybe we should paste the cursor onto an empty 32x32 transparent frame instead? (but only if the frame is bigger than the cursor!..) This will have to do for now. It may well fix the crash with GTK3 too.

More complicated backport than usual because the metrics stuff is not present in the 0.14 branch: done in 8092.

@totaam
Copy link
Collaborator Author

totaam commented Nov 14, 2014

2014-11-14 17:48:38: totaam commented


Better solution using gtk.gdk.Pixbuf.copy_area in r8112: we only scale the cursor if we have to, otherwise fill with empty pixels.
(will backport)

Note: unfortunately this does not fix the cursor crashes on win32 with gtk3 (see #640#comment:12)

@totaam
Copy link
Collaborator Author

totaam commented Nov 19, 2014

2014-11-19 00:02:18: totaam changed status from assigned to closed

@totaam
Copy link
Collaborator Author

totaam commented Nov 19, 2014

2014-11-19 00:02:18: totaam changed resolution from ** to fixed

@totaam
Copy link
Collaborator Author

totaam commented Nov 19, 2014

2014-11-19 00:02:18: totaam commented


Backport in r8112.

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

No branches or pull requests

1 participant