Menu

Changed color palette only takes effect after restart

Jos
2022-11-23
2022-11-30
  • Jos

    Jos - 2022-11-23

    https://www.youtube.com/watch?v=V8TxNhItoH4

    Hello!

    I installed an old version of Solaris with CDE on qemu and, as one can see
    in the movie quoted above, color changes made, take effect everywhere on
    the desktop, without any noticeable delay. How did they do that? In the
    current linux version, the changes take effect only after a restart. Just
    wondering...

    thnx!

     
  • Dusan Peterc

    Dusan Peterc - 2022-11-25

    Probably the graphics system was 8-bit with 256 color palette. Changing the color palette would immediately change the color immediately where the same pixel value was used. So there is no need to refresh the whole graphics screen, just change the palette.
    The palette system also caused the programs to compete for color palette entries. The window manager would use 30 or so colors for text and window decoration, while the others were available for the other programs. If the system ran out of colors, applications would display in false colors or fail to run.
    On 24 bit or 32 bit graphics systems, you need to redraw the whole desktop in order to apply the change. And you don't have to worry about allocating colors in the palette.

     

    Last edit: Dusan Peterc 2022-11-25
  • Jos

    Jos - 2022-11-28

    Hmm interesting, but then this could also be done on a 24 bit system?

     
  • Dusan Peterc

    Dusan Peterc - 2022-11-29

    I think it is not possible.
    On program startup, it reads the various settings, like text color, background color, shadow color... Then it uses the same 24 bit or 32 bit pixel value to draw the Widgets.
    If you change the default colors, the client programs are not notified, so they continue to use the old color values. Only on logout/login, you get the new colors, since settings are re-read.
    If all programs would be written using the similar toolkits, and if toolkits would provide some protocol to notify clients of the changes, and if all client programs would actually use such a protocol, then it would be possible.
    It should be defined somewhere here, if such a thing exists:
    https://www.x.org/releases/X11R7.7/doc/xorg-docs/icccm/icccm.html

     
  • Jos

    Jos - 2022-11-30

    Thnx for the link, I'm gonna look into that! I tried to make it work in my cde/motif theme for xfce, but the update is done by switching xfce's theme to one with updated colors, which is too slow to achieve this...

     

Log in to post a comment.