Opened 13 years ago

Closed 9 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:
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 13 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 9 years ago.
Propegate B_SCREEN_CHANGED message to views, BColorControl reads message and rebuilds itself
modeswitch2.patch (4.0 KB ) - added by jscipione 9 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)

by jscipione, 13 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.

comment:1 by pulkomandy, 13 years ago

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.

in reply to:  1 comment:2 by axeld, 13 years ago

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 by rudolfc, 9 years ago

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

comment:4 by jscipione, 9 years ago

Description: modified (diff)

by jscipione, 9 years ago

Attachment: modeswitch.patch added

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

comment:5 by jscipione, 9 years ago

patch: 01

comment:6 by jscipione, 9 years ago

Owner: changed from axeld to jscipione
Status: newassigned

by jscipione, 9 years ago

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 by rudolfc, 9 years ago

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

comment:8 by jscipione, 9 years ago

Resolution: fixed
Status: assignedclosed

Fixed in hrev50148

Note: See TracTickets for help on using tickets.