[chromium-dev] Re: How to change the cursor smoothly for a view

2009-06-16 Thread Daniel Cowx

Changing the default class cursor to NULL in widget_win.cc makes not
difference that I can see. Any other thoughts?

On Jun 13, 4:00 pm, Ben Goodger (Google) b...@chromium.org wrote:
 No problem. Get well soon!



 On Sat, Jun 13, 2009 at 3:55 PM, Daniel Cowxdaniel.c...@gmail.com wrote:

  Sure, I'll take care of this. It'll have to wait a few days though as
  I broke my index finger and I'm having a bit of a time typing right
  now. Hope that's cool.

  Cheers,
  Daniel

  On Jun 11, 2:55 pm, Ben Goodger (Google) b...@chromium.org wrote:
  It's in the class registration function in widget_win.cc

  -Ben

  On Thu, Jun 11, 2009 at 2:52 PM, Peter Kastingpkast...@google.com wrote:
   On Thu, Jun 11, 2009 at 2:48 PM, Ben Goodger (Google) b...@chromium.org
   wrote:

   Daniel, do you want to try making this change instead? It'll be pretty
   obvious to you if it doesn't work.

   Filed as crbug.com/13926 .  We should try and find if we set a value in 
   the
   WindowWin or WidgetWin (or somewhere) window creation calls and just 
   ditch
   it.
   Daniel, feel free to whip up a patch, if it works Ben or I can review.
   PK
--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: How to change the cursor smoothly for a view

2009-06-16 Thread Peter Kasting
On Mon, Jun 15, 2009 at 11:13 PM, Daniel Cowx daniel.c...@gmail.com wrote:

 Changing the default class cursor to NULL in widget_win.cc makes not
 difference that I can see. Any other thoughts?


Look at all the classes along the inheritance hierarchy between you and the
root and see if anyone else is setting the default cursor class.

PK

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: How to change the cursor smoothly for a view

2009-06-13 Thread Daniel Cowx

Sure, I'll take care of this. It'll have to wait a few days though as
I broke my index finger and I'm having a bit of a time typing right
now. Hope that's cool.

Cheers,
Daniel

On Jun 11, 2:55 pm, Ben Goodger (Google) b...@chromium.org wrote:
 It's in the class registration function in widget_win.cc

 -Ben



 On Thu, Jun 11, 2009 at 2:52 PM, Peter Kastingpkast...@google.com wrote:
  On Thu, Jun 11, 2009 at 2:48 PM, Ben Goodger (Google) b...@chromium.org
  wrote:

  Daniel, do you want to try making this change instead? It'll be pretty
  obvious to you if it doesn't work.

  Filed as crbug.com/13926 .  We should try and find if we set a value in the
  WindowWin or WidgetWin (or somewhere) window creation calls and just ditch
  it.
  Daniel, feel free to whip up a patch, if it works Ben or I can review.
  PK
--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: How to change the cursor smoothly for a view

2009-06-13 Thread Ben Goodger (Google)

No problem. Get well soon!

On Sat, Jun 13, 2009 at 3:55 PM, Daniel Cowxdaniel.c...@gmail.com wrote:

 Sure, I'll take care of this. It'll have to wait a few days though as
 I broke my index finger and I'm having a bit of a time typing right
 now. Hope that's cool.

 Cheers,
 Daniel

 On Jun 11, 2:55 pm, Ben Goodger (Google) b...@chromium.org wrote:
 It's in the class registration function in widget_win.cc

 -Ben



 On Thu, Jun 11, 2009 at 2:52 PM, Peter Kastingpkast...@google.com wrote:
  On Thu, Jun 11, 2009 at 2:48 PM, Ben Goodger (Google) b...@chromium.org
  wrote:

  Daniel, do you want to try making this change instead? It'll be pretty
  obvious to you if it doesn't work.

  Filed as crbug.com/13926 .  We should try and find if we set a value in the
  WindowWin or WidgetWin (or somewhere) window creation calls and just ditch
  it.
  Daniel, feel free to whip up a patch, if it works Ben or I can review.
  PK
 


--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: How to change the cursor smoothly for a view

2009-06-11 Thread Daniel Cowx

I've fixed this flickering problem by calling ::SetClassLong(hwnd,
GCL_HCURSOR, NULL) within my OnMouseEntered and then I reset it back
to the original class cursor in OnMouseExited. Not sure if this is a
reasonable solution or if you even think this is a problem. If so, I
can file a bug report and submit this change for review.

Cheers,
Daniel

On Jun 10, 10:08 pm, Daniel Cowx daniel.c...@gmail.com wrote:
 Actually, I see this flickering on a plain old view::Link as well. You
 can see it if you move the cursor back and forth on say the open
 source software link on the Chromium About dialog.

 On Jun 10, 9:42 pm, Ben Goodger (Google) b...@chromium.org wrote:



  I don't know, check WidgetWin.

  I would be slightly surprised though... we use GetCursorForPoint in a
  couple of places and haven't had issues...

  -Ben

  On Wed, Jun 10, 2009 at 9:39 PM, Daniel Cowxdaniel.c...@gmail.com wrote:

   Hi Ben,

   I'm getting the flickering even when I dont have any children in my
   view. I tried overridding GetViewForPoint for my view class and
   returning this, but I still get this flicker (with or without the
   label and bitmap being present).

   According to MSDN 
   @http://msdn.microsoft.com/en-us/library/ms648393(VS.85).aspx
   snip
   make sure the class cursor for the specified window's class is set to
   NULL. If the class cursor is not NULL, the system restores the class
   cursor each time the mouse is moved.
   /snip

   Could this be the culprit?

   On Jun 10, 9:05 pm, Ben Goodger (Google) b...@chromium.org wrote:
   You want to override GetViewForPoint on the container view and return
   this, rather than allowing the default implementation of the function
   to propagate into the base class impl.

   The reason you're getting flicker is that the default impl of
   RootView::UpdateCursor calls GetViewForPoint which ends up asking both
   the label and the text and the container view for the cursor, so its
   constantly getting reset as you move your mouse over it.

   -Ben

   On Wed, Jun 10, 2009 at 8:55 PM, Daniel Cowxdaniel.c...@gmail.com 
   wrote:

I've got a composite view that consists of a SkBitmap and
views::Label. I'd like to use IDC_HAND (hand cursor) for this
composite view so I've overridden view::GetCursorForPoint(...)

Though this kinda works, it causes the cursor to jitter/flicker as it
calls this function repeatedly based on the current cursor coordinates
within the view. How can I implement the desired functionality without
this flickering?

I've also tried overriding view::OnMouseEntered() and
view::OnMouseExited() and manually calling ::SetCursor() to no avail.
Can someone please shed some light.

Thanks,
Daniel
--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: How to change the cursor smoothly for a view

2009-06-11 Thread Peter Kasting
On Thu, Jun 11, 2009 at 12:26 AM, Daniel Cowx daniel.c...@gmail.com wrote:

 I've fixed this flickering problem by calling ::SetClassLong(hwnd,
 GCL_HCURSOR, NULL) within my OnMouseEntered and then I reset it back
 to the original class cursor in OnMouseExited. Not sure if this is a
 reasonable solution or if you even think this is a problem. If so, I
 can file a bug report and submit this change for review.


Would it be better to just do this in your class' constructor?

Also if there are problems like this with existing classes please file bugs,
and since you have some idea of the fix consider fixing them.  Maybe one of
the base view classes should do this fix?

PK

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: How to change the cursor smoothly for a view

2009-06-11 Thread Peter Kasting
On Thu, Jun 11, 2009 at 9:58 AM, Peter Kasting pkast...@google.com wrote:

 Also if there are problems like this with existing classes please file
 bugs, and since you have some idea of the fix consider fixing them.


It looks like maybe this problem occurs when mousing over text in the
Omnibox -- on Vista my cursor seems to flicker between the pointer and the
I-beam.  Ben, do you see this?  This seems like a regression (and a pretty
noticeable one).  Will file if you confirm.

PK

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: How to change the cursor smoothly for a view

2009-06-11 Thread Peter Kasting
On Thu, Jun 11, 2009 at 2:38 PM, Ben Goodger (Google) b...@chromium.orgwrote:

 Is the default cursor config in the window class even necessary? Isn't
 the default pointer the arrow anyway? Maybe we could just remove it
 from WindowWin.


As long as Windows doesn't make the mouse cursor disappear by default
when doing that, I say let's do it.

Want me to file something, or you want to just patch this?

PK

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: How to change the cursor smoothly for a view

2009-06-11 Thread Ben Goodger (Google)

It's worth a shot. We should make sure this is one of the WNDCLASSEX
fields that when not set causes the window not to be created,
obviously!

-Ben

On Thu, Jun 11, 2009 at 2:40 PM, Peter Kastingpkast...@google.com wrote:
 On Thu, Jun 11, 2009 at 2:38 PM, Ben Goodger (Google) b...@chromium.org
 wrote:

 Is the default cursor config in the window class even necessary? Isn't
 the default pointer the arrow anyway? Maybe we could just remove it
 from WindowWin.

 As long as Windows doesn't make the mouse cursor disappear by default when doing that, I say let's do it.
 Want me to file something, or you want to just patch this?
 PK

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: How to change the cursor smoothly for a view

2009-06-11 Thread Peter Kasting
On Thu, Jun 11, 2009 at 2:48 PM, Ben Goodger (Google) b...@chromium.orgwrote:

 Daniel, do you want to try making this change instead? It'll be pretty
 obvious to you if it doesn't work.


Filed as crbug.com/13926 .  We should try and find if we set a value in the
WindowWin or WidgetWin (or somewhere) window creation calls and just ditch
it.

Daniel, feel free to whip up a patch, if it works Ben or I can review.

PK

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: How to change the cursor smoothly for a view

2009-06-11 Thread Ben Goodger (Google)

It's in the class registration function in widget_win.cc

-Ben

On Thu, Jun 11, 2009 at 2:52 PM, Peter Kastingpkast...@google.com wrote:
 On Thu, Jun 11, 2009 at 2:48 PM, Ben Goodger (Google) b...@chromium.org
 wrote:

 Daniel, do you want to try making this change instead? It'll be pretty
 obvious to you if it doesn't work.

 Filed as crbug.com/13926 .  We should try and find if we set a value in the
 WindowWin or WidgetWin (or somewhere) window creation calls and just ditch
 it.
 Daniel, feel free to whip up a patch, if it works Ben or I can review.
 PK

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: How to change the cursor smoothly for a view

2009-06-10 Thread Daniel Cowx

Hi Ben,

I'm getting the flickering even when I dont have any children in my
view. I tried overridding GetViewForPoint for my view class and
returning this, but I still get this flicker (with or without the
label and bitmap being present).

According to MSDN @ http://msdn.microsoft.com/en-us/library/ms648393(VS.85).aspx
snip
make sure the class cursor for the specified window's class is set to
NULL. If the class cursor is not NULL, the system restores the class
cursor each time the mouse is moved.
/snip

Could this be the culprit?

On Jun 10, 9:05 pm, Ben Goodger (Google) b...@chromium.org wrote:
 You want to override GetViewForPoint on the container view and return
 this, rather than allowing the default implementation of the function
 to propagate into the base class impl.

 The reason you're getting flicker is that the default impl of
 RootView::UpdateCursor calls GetViewForPoint which ends up asking both
 the label and the text and the container view for the cursor, so its
 constantly getting reset as you move your mouse over it.

 -Ben



 On Wed, Jun 10, 2009 at 8:55 PM, Daniel Cowxdaniel.c...@gmail.com wrote:

  I've got a composite view that consists of a SkBitmap and
  views::Label. I'd like to use IDC_HAND (hand cursor) for this
  composite view so I've overridden view::GetCursorForPoint(...)

  Though this kinda works, it causes the cursor to jitter/flicker as it
  calls this function repeatedly based on the current cursor coordinates
  within the view. How can I implement the desired functionality without
  this flickering?

  I've also tried overriding view::OnMouseEntered() and
  view::OnMouseExited() and manually calling ::SetCursor() to no avail.
  Can someone please shed some light.

  Thanks,
  Daniel
--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: How to change the cursor smoothly for a view

2009-06-10 Thread Ben Goodger (Google)

I don't know, check WidgetWin.

I would be slightly surprised though... we use GetCursorForPoint in a
couple of places and haven't had issues...

-Ben

On Wed, Jun 10, 2009 at 9:39 PM, Daniel Cowxdaniel.c...@gmail.com wrote:

 Hi Ben,

 I'm getting the flickering even when I dont have any children in my
 view. I tried overridding GetViewForPoint for my view class and
 returning this, but I still get this flicker (with or without the
 label and bitmap being present).

 According to MSDN @ 
 http://msdn.microsoft.com/en-us/library/ms648393(VS.85).aspx
 snip
 make sure the class cursor for the specified window's class is set to
 NULL. If the class cursor is not NULL, the system restores the class
 cursor each time the mouse is moved.
 /snip

 Could this be the culprit?

 On Jun 10, 9:05 pm, Ben Goodger (Google) b...@chromium.org wrote:
 You want to override GetViewForPoint on the container view and return
 this, rather than allowing the default implementation of the function
 to propagate into the base class impl.

 The reason you're getting flicker is that the default impl of
 RootView::UpdateCursor calls GetViewForPoint which ends up asking both
 the label and the text and the container view for the cursor, so its
 constantly getting reset as you move your mouse over it.

 -Ben



 On Wed, Jun 10, 2009 at 8:55 PM, Daniel Cowxdaniel.c...@gmail.com wrote:

  I've got a composite view that consists of a SkBitmap and
  views::Label. I'd like to use IDC_HAND (hand cursor) for this
  composite view so I've overridden view::GetCursorForPoint(...)

  Though this kinda works, it causes the cursor to jitter/flicker as it
  calls this function repeatedly based on the current cursor coordinates
  within the view. How can I implement the desired functionality without
  this flickering?

  I've also tried overriding view::OnMouseEntered() and
  view::OnMouseExited() and manually calling ::SetCursor() to no avail.
  Can someone please shed some light.

  Thanks,
  Daniel
 


--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: How to change the cursor smoothly for a view

2009-06-10 Thread Daniel Cowx

Actually, I see this flickering on a plain old view::Link as well. You
can see it if you move the cursor back and forth on say the open
source software link on the Chromium About dialog.

On Jun 10, 9:42 pm, Ben Goodger (Google) b...@chromium.org wrote:
 I don't know, check WidgetWin.

 I would be slightly surprised though... we use GetCursorForPoint in a
 couple of places and haven't had issues...

 -Ben



 On Wed, Jun 10, 2009 at 9:39 PM, Daniel Cowxdaniel.c...@gmail.com wrote:

  Hi Ben,

  I'm getting the flickering even when I dont have any children in my
  view. I tried overridding GetViewForPoint for my view class and
  returning this, but I still get this flicker (with or without the
  label and bitmap being present).

  According to MSDN 
  @http://msdn.microsoft.com/en-us/library/ms648393(VS.85).aspx
  snip
  make sure the class cursor for the specified window's class is set to
  NULL. If the class cursor is not NULL, the system restores the class
  cursor each time the mouse is moved.
  /snip

  Could this be the culprit?

  On Jun 10, 9:05 pm, Ben Goodger (Google) b...@chromium.org wrote:
  You want to override GetViewForPoint on the container view and return
  this, rather than allowing the default implementation of the function
  to propagate into the base class impl.

  The reason you're getting flicker is that the default impl of
  RootView::UpdateCursor calls GetViewForPoint which ends up asking both
  the label and the text and the container view for the cursor, so its
  constantly getting reset as you move your mouse over it.

  -Ben

  On Wed, Jun 10, 2009 at 8:55 PM, Daniel Cowxdaniel.c...@gmail.com wrote:

   I've got a composite view that consists of a SkBitmap and
   views::Label. I'd like to use IDC_HAND (hand cursor) for this
   composite view so I've overridden view::GetCursorForPoint(...)

   Though this kinda works, it causes the cursor to jitter/flicker as it
   calls this function repeatedly based on the current cursor coordinates
   within the view. How can I implement the desired functionality without
   this flickering?

   I've also tried overriding view::OnMouseEntered() and
   view::OnMouseExited() and manually calling ::SetCursor() to no avail.
   Can someone please shed some light.

   Thanks,
   Daniel
--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---