I'm working on WinZoom, with permission of the author, to get an OS4 native version of this commodity. It sports some "snap" function to "snap" windows to the title bar. The snapping using HideWindow() works ok. Just the "unsnapping", using ShowWindow(), doesn't make any window visible.
I made some tests with debug output, giving the coordinates/sizes of the window to unsnap, and they seemed to be ok. So I used ShowLayer() with the window's layer as parameter, and voilá, the window appears. It seems that ShowWindow() doesnt make the window layers, hidden by HideWindow(), visible again. Is this a bug?
The documentation says, that ShowWindow() expects some second parameter giving a pointer to the "other" window, which seems to be used as reference for layer placing. It didn't work for any real window pointer I gave to it (returned FALSE), BUT it works for a NULL pointer! Why is this? Is it safe to give a NULL pointer?
ShowWindow() - bug?
Re: ShowWindow() - bug?
whose wrote:..., BUT it works for a NULL pointer! Why is this? Is it safe to give a NULL pointer?
Code: Select all
/* from intuition/intuition.h */
/*
* Special codes for ShowWindow() and WA_InFrontOf:
* Give this as target window where to move your window to.
*/
#define WINDOW_BACKMOST ((struct Window *)0)
#define WINDOW_FRONTMOST ((struct Window *)1)
Why it doesn't work for real windows I can't say. You did use a real window pointer and not an reaction window object pointer?
Re: ShowWindow() - bug?
You´re right, NULL equals to WINDOW_BACKMOST...
Yes, I used several "real Window" pointers (IntuitionBase->ActiveWindow, Screen->FirstWindow, known program windows), but those have no effect at all, ShowWindow() gives FALSE all the time.
I learned that ShowLayer() does the same job, if I use the WLayer pointer. Remarkably, ALL layers are visible after this. In OS3 times, I would need to do ShowLayer() on BorderLayer etc. to make the whole WIndow visible again.
Maybe this is why ShowWindow() doesn´t work at all? Never tested, because ShowLayer() does the same job?
Yes, I used several "real Window" pointers (IntuitionBase->ActiveWindow, Screen->FirstWindow, known program windows), but those have no effect at all, ShowWindow() gives FALSE all the time.
I learned that ShowLayer() does the same job, if I use the WLayer pointer. Remarkably, ALL layers are visible after this. In OS3 times, I would need to do ShowLayer() on BorderLayer etc. to make the whole WIndow visible again.
Maybe this is why ShowWindow() doesn´t work at all? Never tested, because ShowLayer() does the same job?
Re: ShowWindow() - bug?
*bump*
No OS developer here who could say something about ShowWindow() and the strange behaviour? I would really like to produce clean code, in a way that it uses symmetric system calls instead of one Window related and one doing (yet unknown) things on one or more Layer structures...
No OS developer here who could say something about ShowWindow() and the strange behaviour? I would really like to produce clean code, in a way that it uses symmetric system calls instead of one Window related and one doing (yet unknown) things on one or more Layer structures...
Re: ShowWindow() - bug?
We'd really like to get WinZoom (I'm the original author) ported properly - who is responsible for Intuition stuff in OS4?
- salass00
- AmigaOS Core Developer
- Posts: 530
- Joined: Sat Jun 18, 2011 3:12 pm
- Location: Finland
- Contact:
Re: ShowWindow() - bug?
@whose
If you can post some code that doesn't work for you that is using ShowWindow() that I can use for testing then I can look into this.
If you can post some code that doesn't work for you that is using ShowWindow() that I can use for testing then I can look into this.
Re: ShowWindow() - bug?
Hi salass00,
I will prepare some example code which is hiding it´s own window (and tries to ShowWindow() it again), as the code of our question is a bit too complex to post it here as a working example. Might last two or three days, until I get to it, but I will post it Thank you very much in advance!
I will prepare some example code which is hiding it´s own window (and tries to ShowWindow() it again), as the code of our question is a bit too complex to post it here as a working example. Might last two or three days, until I get to it, but I will post it Thank you very much in advance!