Minimizing windows doesn't work

I can’t make minimize a dialog or window other than the base window. I’m
using QNX 6.3.0 SP1 and PhAB 2.03.

I create the base window (plain, but other types exhibit the same
problem), and two buttons. I attach a module callback to one button that
creates a dialog, the other button has a module callback that creates a
window.

I can minimize the base window, but the minimize buttons on both the
dialog and created-window do nothing. The other buttons on the dialog and
window (maximize, restore, close) all work.

I’ve also tried adding code to set Pt_ARG_WINDOW_STATE to
Ph_WM_STATE_ISHIDDEN via PtSetResource() and via PtForwardWindowEvent().
Neither worked. Suggestions?

Thanks,
Rick

Minimizing child windows has never been implemented. As a workaround,
you can unrealize the window instead.

(Since child windows never show up on the taskbar anyway, the biggest
difference between unrealizing and minimizing is that minimizing gives
you some memory back by destroying all the regions.)

Rick Pike wrote:

I can’t make minimize a dialog or window other than the base window. I’m
using QNX 6.3.0 SP1 and PhAB 2.03.

I create the base window (plain, but other types exhibit the same
problem), and two buttons. I attach a module callback to one button that
creates a dialog, the other button has a module callback that creates a
window.

I can minimize the base window, but the minimize buttons on both the
dialog and created-window do nothing. The other buttons on the dialog and
window (maximize, restore, close) all work.

I’ve also tried adding code to set Pt_ARG_WINDOW_STATE to
Ph_WM_STATE_ISHIDDEN via PtSetResource() and via PtForwardWindowEvent().
Neither worked. Suggestions?

Thanks,
Rick

Wojtek Lerch wrote:

Minimizing child windows has never been implemented. As a workaround,
you can unrealize the window instead.

(Since child windows never show up on the taskbar anyway, the biggest
difference between unrealizing and minimizing is that minimizing gives
you some memory back by destroying all the regions.)

Rick Pike wrote:
I can’t make minimize a dialog or window other than the base window. I’m
using QNX 6.3.0 SP1 and PhAB 2.03.

I create the base window (plain, but other types exhibit the same
problem), and two buttons. I attach a module callback to one button that
creates a dialog, the other button has a module callback that creates a
window.

I can minimize the base window, but the minimize buttons on both the
dialog and created-window do nothing. The other buttons on the dialog and
window (maximize, restore, close) all work.

I’ve also tried adding code to set Pt_ARG_WINDOW_STATE to
Ph_WM_STATE_ISHIDDEN via PtSetResource() and via PtForwardWindowEvent().
Neither worked. Suggestions?

Thanks,
Rick

Thanks. I was really hoping to create the window or dialog in the hidden
state, then unhide it when I needed it. That didn’t work (because it’s not
implemented, no doubt), but my workaround was to create the window
off-screen, then move it onscreen when I wanted to make it visible.

Rick Pike wrote:

Wojtek Lerch wrote:

Minimizing child windows has never been implemented. As a workaround,
you can unrealize the window instead.

(Since child windows never show up on the taskbar anyway, the biggest
difference between unrealizing and minimizing is that minimizing gives
you some memory back by destroying all the regions.)

What was I smoking? It’s unrealizing that gives you some memory back by
destroying the regions. Minimizing just puts them behind the backdrop.

Thanks. I was really hoping to create the window or dialog in the hidden
state, then unhide it when I needed it. That didn’t work (because it’s not
implemented, no doubt), but my workaround was to create the window
off-screen, then move it onscreen when I wanted to make it visible.

Maybe it’s only because I tend to be paranoid, but I wouldn’t trust a
window sitting off-screen to never interfere with things going on
on-screen. Someone with a similar attitude might happen phditto that
part of the Photon space and expect to find nothing there. The window
manager may pick your window and give it focus when another window is
closed. And that’s just the possibilities that I could think of.

Leaving your widgets unrealized makes sure that nobody outside of your
process has a way to find out that they exist. Like I said (in the
corrected version), it also lets you save some memory. And a few CPU
cycles, too, because every time a window draws, Photon needs to run the
list of all the regions in front of the one that draws, on screen or
not, to find the ones that obstruct the view.