Opened 8 years ago

Closed 8 years ago

#12229 closed defect (fixed)

Drawing errors in Cocoa wxListCtrl

Reported by: bdheller Owned by: csomor
Priority: normal Milestone:
Component: wxOSX Version:
Keywords: wxListCtrl Cc:
Blocked By: Blocking:
Patch: no


The focus rectangle drawn around the selected row in wxListCtrl of the OSX/Cocoa port (trunk version) is not completely erased during redrawing. To reproduce just select random rows in the listctrl sample. I have attached a screen shot of the listctrl sample for illustration.

(r64879 sounds like it might be the cause or at least related, but I haven't tested without that changeset)

Attachments (1)

screenshot.png download (39.0 KB) - added by bdheller 8 years ago.

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by bdheller

comment:1 Changed 8 years ago by vadz

Is this with generic or native version?

comment:2 Changed 8 years ago by bdheller

I do not think there is a true native version in the OSX/Cocoa port. The behaviour in the sample is the same if "generic" is selected or not.

comment:3 Changed 8 years ago by vadz

  • Owner set to vadz
  • Status changed from new to accepted

Oops, you're right, sorry. Will look.

comment:4 Changed 8 years ago by vadz

  • Owner vadz deleted
  • Status changed from accepted to new

It's true that r64879 made things even worse but they were pretty broken before too. Even if all use of wxRendererNative is disabled there are still grey outlines drawn around the items which are not erased when the focus changes. Unfortunately I just have absolutely no idea where do they come from.

I'll remove the use of DrawFocusRect() for Mac as it clearly just does the wrong thing there (it draws the focus rectangle as it's drawn around a selected control, such as a button, instead of a selected item in a list-like control) but the appearance is still broken and I don't know how to fix it.

comment:5 Changed 8 years ago by VZ

(In [64966]) Don't use wxRendererNative::DrawFocusRect() under Mac.

This function doesn't do the right thing there, it draws the focus border as
it's drawn around controls such as buttons. This border overflows the item
rectangle and results in garbage remaining on screen when selection changes.

See #12229.

comment:6 Changed 8 years ago by csomor

  • Owner set to csomor
  • Status changed from new to accepted

the problem seems to be an incomplete Clear of the background: when I'm adding a Clear in the OnPaint, then things are fine, but this should be done in the erase background handling already, trying to find out what goes wrong ...

comment:7 Changed 8 years ago by SC

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [65002]) organizing code, adding offset correction for update region when non native control borders are used, fixes #12229

Note: See TracTickets for help on using tickets.