Opened 8 years ago

Closed 3 years ago

#8035 closed bug (fixed)

BColorControl not redrawn when switching to and from 8-bit (256 color) mode

Reported by: jscipione Owned by: jscipione
Priority: low Milestone: R1
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: yes Platform: All

Description (last modified by jscipione)

BColorControl doesn't redraw itself when switching to or from 8-bit (256 color) mode. Perhaps the app server should tell all controls to redraw themselves when you switch modes.

Attachments (3)

8-bit to 32-bit mode ColorControl.png (39.3 KB) - added by jscipione 8 years ago.
Screenshot showing a BColorControl object in the Desktop Preferences pane fail to get redrawn when switching from 8-bit mode to 32-bit mode.
modeswitch.patch (2.0 KB) - added by jscipione 3 years ago.
Propegate B_SCREEN_CHANGED message to views, BColorControl reads message and rebuilds itself
modeswitch2.patch (4.0 KB) - added by jscipione 3 years ago.
ebuild control after mode switch App Server sends each window a message that the screen has changed: https://www.haiku-os.org/legacy-docs/bebook/BWindow.html#BWindow_ScreenChanged Propegate B_SCREEN_CHANGED message to all child views first Tell BColorControl to read the B_SCREEN_CHANGED message and reinitialize itself. * Only reinit if switching to or from B_CMAP8 * Initialize all pointers to NULL in constructor * Don't destroy and rebuild offscreen view (and text views) on reinit * Reinitialize offscreen view on reinit.

Download all attachments as: .zip

Change History (11)

Changed 8 years ago by jscipione

Screenshot showing a BColorControl object in the Desktop Preferences pane fail to get redrawn when switching from 8-bit mode to 32-bit mode.

comment:1 Changed 8 years ago by pulkomandy

Component: Servers/app_serverKits/Interface Kit
Priority: normallow

Redrawing is not enough, as BColorControl is a complex BView with other controls inside. Basically the only way out is destroying it entirely and building an entirely new one. But this risks breaking stuff around it for example if used in a layouted window...

Everything is obviously redrawn properly, as you can see when switching to 32 bit all controls use the available colors :). So the bug is in the interface kit. Switching component and changing priority.

comment:2 in reply to:  1 Changed 8 years ago by axeld

Replying to pulkomandy:

Redrawing is not enough, as BColorControl is a complex BView with other controls inside. Basically the only way out is destroying it entirely and building an entirely new one. But this risks breaking stuff around it for example if used in a layouted window...

Not really. All it would have to do is update its cell size -- it does all the drawing itself, and the only other controls are not affected in palette mode AFAIK (even then they could be hidden/shown as needed).

comment:3 Changed 4 years ago by rudolfc

Actually also other colorspaces don't issue a redraw. So switch between any from: CMAP8, 15,16 and 32bit modes..

comment:4 Changed 3 years ago by jscipione

Description: modified (diff)

Changed 3 years ago by jscipione

Attachment: modeswitch.patch added

Propegate B_SCREEN_CHANGED message to views, BColorControl reads message and rebuilds itself

comment:5 Changed 3 years ago by jscipione

Has a Patch: set

comment:6 Changed 3 years ago by jscipione

Owner: changed from axeld to jscipione
Status: newassigned

Changed 3 years ago by jscipione

Attachment: modeswitch2.patch added

ebuild control after mode switch App Server sends each window a message that the screen has changed: https://www.haiku-os.org/legacy-docs/bebook/BWindow.html#BWindow_ScreenChanged Propegate B_SCREEN_CHANGED message to all child views first Tell BColorControl to read the B_SCREEN_CHANGED message and reinitialize itself. * Only reinit if switching to or from B_CMAP8 * Initialize all pointers to NULL in constructor * Don't destroy and rebuild offscreen view (and text views) on reinit * Reinitialize offscreen view on reinit.

comment:7 Changed 3 years ago by rudolfc

jscipione, While you're at it, can you please also have a look at ticket #12673? Thanks!

comment:8 Changed 3 years ago by jscipione

Resolution: fixed
Status: assignedclosed

Fixed in hrev50148

Note: See TracTickets for help on using tickets.