ice-wm / icewm

IceWM releases only, see Wiki
https://github.com/ice-wm/icewm/releases
Other
289 stars 16 forks source link

icewmbg shuts down after startup #137

Closed linux-rocks closed 1 year ago

linux-rocks commented 1 year ago

In release 1.6.4 icewmbg would stay up after initial startup. In release 2.9.6 this no longer happens. It starts then shuts down.

Problem that this causes is when using icewm in a virtual and the virtual resizes the picture does not.

The problem was induced in 2.9.4 "Set icewmbg background color as a pixmap to overcome limitations in p…"

icewmbg.cc Background::changeBackground

Old Code:

    if (false == supportSemitransparency &&
        backgroundImages.getCount() <= 1 &&
        backgroundColors.getCount() <= 1)
    {
        this->exit(0);
    }

New Code:

    if (backgroundImages.getCount() <= 1 &&
        backgroundColors.getCount() <= 1)
    {
        XKillClient(display(), AllTemporary);
        XSetCloseDownMode(display(), RetainTemporary);
        XSync(display(), False);
        XCloseDisplay(display());
        _exit(0);
    }

Fix (although there is probably a better one because I don't know why it's checking for getCount()) is to add (false == supportSemitransparency) back in the if check ... that prevents it from going in the if check and shutting down.

gijsbers commented 1 year ago

So the requirement you ask for is to adjust the background pixmap when the display geometry changes. The advantage of the existing solution is that icewmbg doesn't use system memory anymore when it exits. That is important, because icewm is used on computers with little system memory. To address your problem, either icewm-session or icewm could detect a change in display geometry and restart icewmbg for a screen update. Again icewmbg would exit once the root pixmap has been set.

linux-rocks commented 1 year ago

I was wondering why it was exiting - the man pages led me to believe it was started by icewm-session and stayed up. Having icewm-session monitor changes would be good since that is what starts it up anyway. Makes sense.

gijsbers commented 1 year ago

This lets icewm signal icewm-session to verify icewmbg is running. The manpage clarifies. Thanks for reporting.