Opened 4 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#415 closed enhancement (fixed)

AREXX: Add WINDOWTOFRONT option

Reported by: Hubert Maier Owned by: Thore Böckelmann
Priority: normal Milestone: 5.0-2019R3
Component: muimaster.library Version: 5.0-2019R2
Severity: minor Keywords:
Cc: OS Platform: AmigaOS4
Blocked By: Blocking:
Release Notes:

Description

Problem

AREXX is application specific, i haven't found a way to bring a MUI app window to front.

Analysis

There is a workaround, but it's ugly and looks wrong, if not buggy.

By sending HIDE and SHOW to, e.g. Odyssey, one after the other, makes the window vanish and appear again (in front of all the other windows).
But it looks flickery and everything else than smooth (plus it looks buggy, if the window was already in front).

Enhancement recommendation

Please add a WINDOWTOFRONT AREXX option to MUI's default AREXX command set.

Change History (7)

comment:1 Changed 3 weeks ago by Thore Böckelmann

An ARexx function like this is not as easy to implement as it might appear for a normal user. Odyssey might feature a single main window, but there are lots of other MUI applications which use more than one window. A general "window to front" or "to back" is not sufficient, because in general it is unclear which window (of several windows) is desired to be moved to the front.

Hence such a command would require a kind of window handle or window ID to be able to affect that single window only. But that in turn requires yet another ARexx command to obtain a list of currently available windows within that application. From this list a user (!) must choose the one window to be brought to the front.

Funny side fact: even the oldest MUI3 code I have access to already features a large block of commented out functions, like "window to front", "zoom window", "change window position". But all of these functions are completely empty and unimplemented. So it seems that Stefan Stuntz planned to implement exactly what you ask for here. But for unknown reasons (at least unknown to me) he never finished this work. Maybe due to the necessary overhead I explained before.

Coming to think more about this request, there could be an alternative, not exactly the same, but quite similar. I could implement an application wide "all windows to front" and "to back". For Odyssey this would result in your desired reaction, but only as long as there is only a single window open. As soon as there is a second or more windows open the result will be unpredicatable, because all MUI can do is to iterate over the list of window objects and bring each opened window to the front, no matter which one is the first or the last and hence eventually the frontmost.

comment:2 Changed 3 weeks ago by Hubert Maier

Thank you for considering it.

What i don't understand is, why it may be a problem if an application features window id's.

For example, odyssey do have window id's, using odyssey.1 (.2, .3 etc.).

If I now explicitly pick odyssey.1 to address it from show(ports), I could easily send a potential windowtofront to just that instance, couldn't I?

I also don't think it would be a good idea to generalize such command, rather let the arexx script take care of which instance is used.
Just my opinion.

But maybe I don't really understand the problem behind such a feature?

comment:3 in reply to:  2 Changed 3 weeks ago by Thore Böckelmann

Replying to Hubert Maier:

What i don't understand is, why it may be a problem if an application features window id's.

For example, odyssey do have window id's, using odyssey.1 (.2, .3 etc.).

If I now explicitly pick odyssey.1 to address it from show(ports), I could easily send a potential windowtofront to just that instance, couldn't I?

These are not window IDs, but application IDs. Each instance of an application gets a unique ID based on the application's base name, no matter how many windows are involved. Hence 'Odyssey.2' refers the the second instance of Odyssey, not to the second window of a single Odyssey instance. Just use a task manager like Scout to see how many Odyssey processes are running.

I also don't think it would be a good idea to generalize such command, rather let the arexx script take care of which instance is used.
Just my opinion.

But maybe I don't really understand the problem behind such a feature?

comment:4 Changed 3 weeks ago by Hubert Maier

Ok, now i got it.

I'd be happy with an extra arexx command to create such a windows list.
I have to write the script anyway so one more
command/loop to obtain such list and grab the correct window out of it would still be ok imho.

comment:5 Changed 3 weeks ago by Thore Böckelmann

Owner: set to Thore Böckelmann
Resolution: fixed
Status: newclosed

In 6452:

  • Application.c, masterrexx.c: implemented the ARexx commands TOFRONT and TOBACK to bring all windows of an application to the front and to the back while keeping the relative Z order of all windows. This in essence fulfills the requirements of ticket #415 and hence closes #415, although the commands affect ALL windows instead of specific ones.

comment:6 Changed 3 weeks ago by Hubert Maier

Thank you.
Can't wait to test

comment:7 Changed 3 weeks ago by Thore Böckelmann

Component: undefinedmuimaster.library
Milestone: future release5.0-2019R3
Priority: undecidednormal
Note: See TracTickets for help on using tickets.