Bug 157794 - [GTK] Clean up CursorGtk.cpp
Summary: [GTK] Clean up CursorGtk.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: Other
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-17 08:07 PDT by Michael Catanzaro
Modified: 2016-08-21 03:57 PDT (History)
3 users (show)

See Also:


Attachments
Patch (33.10 KB, patch)
2016-05-17 08:13 PDT, Michael Catanzaro
no flags Details | Formatted Diff | Diff
Patch (31.73 KB, patch)
2016-08-16 05:50 PDT, Michael Catanzaro
no flags Details | Formatted Diff | Diff
Patch (31.73 KB, patch)
2016-08-16 06:01 PDT, Michael Catanzaro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2016-05-17 08:07:23 PDT
We use GdkCursorType extensively in CursorGtk.cpp, but GTK+ does not support this anymore and they're only sure to work under X11. Instead, use supported CSS cursor names.

Also, we have a bunch of custom cursors copied from Firefox. Each of these cursors is nowadays guaranteed to be provided by GTK+, so we don't need any of these anymore.
Comment 1 Michael Catanzaro 2016-05-17 08:13:04 PDT
Created attachment 279124 [details]
Patch
Comment 2 Darin Adler 2016-05-23 23:03:56 PDT
Comment on attachment 279124 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=279124&action=review

> Source/WebCore/platform/gtk/CursorGtk.cpp:49
> +typedef struct {
> +    const char* name;
> +    const unsigned char* bits;
> +    const unsigned char* mask_bits;
> +    int hot_x;
> +    int hot_y;
> +} CustomCursor;

Where is this used?
Comment 3 Michael Catanzaro 2016-05-25 08:08:48 PDT
(In reply to comment #2)
> Where is this used?

Nowhere :)
Comment 4 Carlos Garcia Campos 2016-05-27 03:34:12 PDT
Comment on attachment 279124 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=279124&action=review

> Source/WebCore/platform/gtk/CursorGtk.cpp:73
> -        m_platformCursor = adoptGRef(gdk_cursor_new(GDK_CROSS));
> +        m_platformCursor = adoptGRef(gdk_cursor_new_from_name(gdk_display_get_default(), "crosshair"));

Maybe we can leave the createNamedCursor helper, but receiving a const char* instead and simply calling gdk_cursor_new_from_name for the default display.
Comment 5 Michael Catanzaro 2016-08-16 02:17:45 PDT
Hm, forgot about this. It should hopefully fix a strange bug we have where our mouse cursor sometimes turns into a crap X11 fallback cursor when hovering over links in Wayland. It's because we set the cursor to GDK_HAND2, which is not supported anymore.

(In reply to comment #2)
> Comment on attachment 279124 [details]
> Where is this used?

I'll delete it, good catch.

(In reply to comment #4)
> Maybe we can leave the createNamedCursor helper, but receiving a const char*
> instead and simply calling gdk_cursor_new_from_name for the default display.

OK.
Comment 6 Michael Catanzaro 2016-08-16 05:50:26 PDT
Created attachment 286172 [details]
Patch
Comment 7 Michael Catanzaro 2016-08-16 06:01:04 PDT
Created attachment 286173 [details]
Patch
Comment 8 WebKit Commit Bot 2016-08-21 03:57:12 PDT
Comment on attachment 286173 [details]
Patch

Clearing flags on attachment: 286173

Committed r204691: <http://trac.webkit.org/changeset/204691>
Comment 9 WebKit Commit Bot 2016-08-21 03:57:16 PDT
All reviewed patches have been landed.  Closing bug.