Bug 16371 - Implement additional mouse cursors for Gtk
Summary: Implement additional mouse cursors for Gtk
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Linux
: P2 Major
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2007-12-09 15:36 PST by Christian Dywan
Modified: 2007-12-11 05:23 PST (History)
0 users

See Also:


Attachments
Initial patch with several new cursors (14.11 KB, patch)
2007-12-09 15:40 PST, Christian Dywan
no flags Details | Formatted Diff | Diff
Updated, using enums, a struct and correct hotspots now (14.78 KB, patch)
2007-12-10 03:49 PST, Christian Dywan
alp: review-
Details | Formatted Diff | Diff
Updated with ChangeLog (16.37 KB, patch)
2007-12-11 03:28 PST, Christian Dywan
alp: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Dywan 2007-12-09 15:36:25 PST
There are several mouse cursors missing, ie. currently a default pointer is used for all unsupported cursors. The missing cursors that are not guaranteed to be available should have hardcoded defaults and allow for custom themed replacements.
Comment 1 Christian Dywan 2007-12-09 15:40:54 PST
Created attachment 17810 [details]
Initial patch with several new cursors

This patch implements vertical-text, context-menu, copy, alias, zoom-in and zoom-out. These names are overridable by cursor themes.

The hardcoded cursor images are taken from [1], so I added the original author to the copyright line. I hope that is appropriate.

[1] http://lxr.mozilla.org/mozilla1.8/source/widget/src/gtk2/nsGtkCursors.h?raw=1
Comment 2 Christian Dywan 2007-12-10 03:49:11 PST
Created attachment 17817 [details]
Updated, using enums, a struct and correct hotspots now
Comment 3 Alp Toker 2007-12-10 05:57:49 PST
Comment on attachment 17817 [details]
Updated, using enums, a struct and correct hotspots now

>-// FIXME: should find better GDK cursors for those than a generic GDK_LEFT_PTR
>+static GdkCursor* custom_cursor_new(CustomCursorType cursorType)

That can just be a TODO rather than a FIXME. The function should have a camelCase name since this is WebCore code. (The names of the moz_ variables don't matter so much, you can leave them as-is.)

>+
> const Cursor& verticalTextCursor()
> {
>-    return pointerCursor();
>+    static Cursor c = custom_cursor_new(CustomCursorVerticalText);
> }

This function is missing a 'return c;'

Could you write a ChangeLog entry, including a mention of where the code was borrowed from?

Thanks!
Comment 4 Christian Dywan 2007-12-11 03:28:02 PST
Created attachment 17842 [details]
Updated with ChangeLog
Comment 5 Alp Toker 2007-12-11 05:17:43 PST
Comment on attachment 17842 [details]
Updated with ChangeLog

r=me 

Will remove the GLib use from the header file, remove the deprecated unref calls, fix a minor formatting issue (space missing in if statement), and constify fg and bg before landing.

Thanks!
Comment 6 Alp Toker 2007-12-11 05:23:59 PST
Landed in r28613.