Support monochrome cursors when GTK version is less than 2.4

RESOLVED FIXED in mozilla1.9alpha1

Status

()

Core
Widget: Gtk
P3
minor
RESOLVED FIXED
12 years ago
11 years ago

People

(Reporter: Darin Fisher, Assigned: Biesinger)

Tracking

({fixed1.8.1})

Trunk
mozilla1.9alpha1
x86
Linux
fixed1.8.1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

12 years ago
Support monochrome cursors when GTK version is less than 2.4

It'd be cool if we still supported URL-valued CSS cursors on older systems that
do not have the ability to render full-color cursors.  Biesi suggested that we
could do this by rendering the supplied images as monochrome.
Created attachment 196101 [details] [diff] [review]
patch

I'm not sure whether this is the best possible algorithm... I'm currently
making the pixel black if the average of the r,g,b values is < 128.
Attachment #196101 - Flags: review?(bryner)
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla1.9alpha
darin: could you verify that this patch works under your gtk version? I only
have gtk 2.6 available.
(Reporter)

Comment 3

12 years ago
Works great!  Thanks for the patch, biesi :)
Component: Style System (CSS) → Widget: Gtk
QA Contact: ian → gtk
Would it make more sense to look at the luminance instead of the average?
hmm, it may... do we have an easy way to get that?
http://lxr.mozilla.org/seamonkey/source/layout/base/nsCSSColorUtils.h#64 and the corresponding cpp has some code.  Maybe it should move to nsColor?
Attachment #196101 - Flags: review?(bryner) → review+
Comment on attachment 196101 [details] [diff] [review]
patch

ok, I think I don't want to move that function around as part of this bug, so I'll file a new bug on that.
Attachment #196101 - Flags: superreview?(roc)
Attachment #196101 - Flags: superreview?(roc) → superreview+
filed bug 329646 for luminance

Checking in widget/src/gtk2/nsWindow.cpp;
/cvsroot/mozilla/widget/src/gtk2/nsWindow.cpp,v  <--  nsWindow.cpp
new revision: 1.160; previous revision: 1.159
done
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
Comment on attachment 196101 [details] [diff] [review]
patch

I think this would also be good for firefox 2.
Attachment #196101 - Flags: approval-branch-1.8.1?(roc)
I'm not really sure about that ... I'd like to see some reports of actual problems in the wild

Updated

11 years ago
Attachment #196101 - Flags: approval-branch-1.8.1?(roc) → approval1.8.1?
(Reporter)

Updated

11 years ago
Attachment #196101 - Flags: approval1.8.1? → approval1.8.1+
Checked in on MOZILLA_1_8_BRANCH

Checking in widget/src/gtk2/nsWindow.cpp;
/cvsroot/mozilla/widget/src/gtk2/nsWindow.cpp,v  <--  nsWindow.cpp
new revision: 1.145.2.3; previous revision: 1.145.2.2
done
Keywords: fixed1.8.1
You need to log in before you can comment on or make changes to this bug.