Who's Online |
121 user(s) are online ( 91 user(s) are browsing Forums)
Members: 0
Guests: 121
more...
|
|
|
|
Re: wb2filer v0.7
|
Posted on: 12/16 7:17
#81
|
Home away from home
|
@joerg Thanks ! Fixed all! Quote: You can use simple C library string functions like strlen(), str(i)cmp(), strstr(), etc., just not string function which allocate memory (strdup(), asnprintf(), etc.).
Just already replaced everything and to make it all looks "in one style" want to get rid of "strstr()" and in whole want to get rid of whole newlib , just to be OS4 native only.. Maybe worth just implement it internally ? Like:
char *strstrOS4(const char *str, const char *substring)
{
const char *a;
const char *b;
/* First scan quickly through the two strings looking for a
* single-character match. When it's found, then compare the
* rest of the substring.
*/
b = substring;
if (*b == 0) {
return (char *) str;
}
for ( ; *str != 0; str += 1) {
if (*str != *b) {
continue;
}
a = str;
while (1) {
if (*b == 0) {
return (char *) str;
}
if (*a++ != *b++) {
break;
}
}
b = substring;
}
return NULL;
}
Also do you aware of the replacement of newlibs/clib2 exit(0) ? Something like return(RETURN_OK); ? I also want to ditch completely C lib, and wrote it as pure amigaos4 binary without C startup code. Maybe you aware how properly do it so to not be hardcoded to value 4, and so on ? Currently i just doing it like this:
#define __NOLIBBASE__
#define __NOGLOBALIFACE__
#include <proto/exec.h>
#include <proto/dos.h>
struct ExecBase *SysBase = NULL;
struct ExecIFace *IExec = NULL;
struct Library *DOSBase = NULL;
struct DOSIFace *IDOS = NULL;
int _start()
{
if(SysBase = *(struct ExecBase **)4) {
IExec = (struct ExecIFace *)SysBase->MainInterface;
}
if(DOSBase = IExec->OpenLibrary("dos.library", 37)) {
IDOS = (struct DOSIFace *)IExec->GetInterface(DOSBase, "main", 1, NULL);
}
IDOS->Printf("YEAAAH\n");
if(DOSBase) {
IExec->DropInterface((struct Interface *)IDOS);
IExec->CloseLibrary((struct Library *)DOSBase);
DOSBase = NULL;
}
if(IExec) {
IExec->DropInterface((struct Interface *)IExec);
}
}
And i also need to get rid of main() then in favor of _start(), so probabaly need to switch to native ReadArgs() way ?
Edited by kas1e on 2023/12/16 7:39:41 Edited by kas1e on 2023/12/16 7:42:37 Edited by kas1e on 2023/12/16 9:43:37 Edited by kas1e on 2023/12/16 10:14:55 Edited by kas1e on 2023/12/16 13:10:05
|
|
|
|
Re: wb2filer v0.7
|
Posted on: 12/16 3:03
#82
|
Home away from home
|
@ktadd You seem to download very old version, like the first ones or so (probably 03 one as the name of your folder suggest so) ?:) Display beep were dealt with long ago and selection of icon were removed too in favor of better and easy way: The version to check is 07 one currently. @joerg Quote: Remove usage of malloc and I/O based functions, incl. functions like strdup(), asnprintf(), etc., in the patched functions.
Ok so: asnprintf -> IUtility->SNPrintf() strlen -> IUtility->StrLen() stricmp -> IUtility->Stricmp() strcmp -> IUtility->Stricmp() again (on os4 we anyway have no issues regarding the case) but what about strstr() ? Quote: Should't %c for this works as for asnprinf ? Just tried simple:
char command_line_test[1024];
int ret_test = IUtility->SNPrintf(command_line_test,1024,"%c", 'A');
And it printf nothing on serial, but for %s strings printing works. Also, this buffer_size for the second argument is unknown when we use dinamic strings with char *, will 1024 fits in ? As i read OS4's SNPrintF add \0 anyway after adding necessary bits to the buffer, so probably limit to 1024 should fits just fine for the path to the Filer + name of partition ? Quote: For allocating memory only use IExec->AllocVecTags()/FreeVec()
Can i do :
char command_line_test[1024];
SNPrintF ....;
FreeVec(command_line_test);
? Or i had to allocate in any case with AllocVecTags instead of pure "char command_line[xxxx]" ?
Edited by kas1e on 2023/12/16 4:00:49 Edited by kas1e on 2023/12/16 4:05:48 Edited by kas1e on 2023/12/16 4:09:54 Edited by kas1e on 2023/12/16 4:12:16 Edited by kas1e on 2023/12/16 4:21:03 Edited by kas1e on 2023/12/16 4:27:53 Edited by kas1e on 2023/12/16 4:28:54
|
|
|
|
Re: wb2filer v0.7
|
Posted on: 12/15 2:05
#83
|
Home away from home
|
@balaton Thanks for your inputs again :) Quote: Now that selList is gone and you don't need to free it at the end and just call Original_OpenWindowTagList(Self, nw, tagList) on error, you could get rid of the ok flag as well and write out return Original_OpenWindowTagList(Self, nw, tagList); everywhere. If you want to keep the flag and goto in case some clean up will be necessary in the future then use it consistently so also here should be goto end then: if (strcmp(Caller->tc_Node.ln_Name, node->ln_Name) != 0) { return Original_OpenWindowTagList(Self, nw, tagList); }
Yes, want to keep goto way, it looks nicer and "goto end" sound self-explained too. But why we need at end check on Called/Node names as well ? Because if we at end, we already checked if we should return original window or null ? Quote: you're probably modifying the window title with this;
Oh right, strtok() messed up the string we feed to by adding \0 where separator find! Maybe then just that:
// Find in string first space separator, replace it with ":" instead, and add \0 to finalize the string
char *icon_name = nw->Title;
int len = strlen(icon_name);
for(int a=0; a < len; a++)
{
if(icon_name[a] == '\x20') {
icon_name[a] = ':';
icon_name[a+1] = '\x00';
a=len;
}
}
if (!icon_name || !icon_name[0] || icon_name[strlen(icon_name)-1] != ':') goto end;
char *command_line = NULL;
int ret = asprintf(&command_line, "%s%c%c%s%c", filer_binary, ' ', '"', icon_name, '"');
if (ret < 0) goto end;
? Simple and easy, no additional functions calls (only strlen), etc. Quote: At the beginning, checks are mixed up again, should be: if (!nw || !(nw->Flags & WFLG_WBENCHWINDOW)) goto end; struct Task *Caller = (struct Task *)IExec->FindTask(NULL); if (!Caller || stricmp(Caller->tc_Node.ln_Name, "Workbench") != 0) goto end; (or you can write it all in one line if you don't care about avoiding a call to FindTask when not needed or if you need to check Caller before window attributes).
Yeah, i specially doing so, because there is a problem : the AsyncWB window is not WFLG_WBENCHWINDOW, and not Workbench name, and have no newWindow struct, but, do have a task and name of task. So i had to change the order to firstly find a task, check if the name is AsyncWB, and mark it that next window will be "original" one, and only then do other kind of checks. But it's all looks ugly indeed. Maybe ditch this whole AsyncWB thing and let it be "Filer" when run WBRun from ? Quote: - The skip_AsyncWB may have same problem as suppressing next beep but unlike that it may cause problems here. What happens if you run multiple wbrun commands e.g. from a script at the same time or quickly one after the other? Is there a better way to identify call after AsyncWB?
Dunno, i just found that when you hit "amiga+e" we do have 2 openwindowcalls() , one to call "AsyncWB - textinput process", which have no NW, no "Workbench", and no WFLG_WBENCHWINDOW, and then our OpenWindowTagList() which we need to handle. But then it's still ugly and add unnecessary all-the-time checks when not need it.. @khayoz Yeah, there were missing null pointer check, try this one in meantime: https://kas1e.mikendezign.com/aos4/wb2 ... WB2Filer_pre08_binary.zip
Edited by kas1e on 2023/12/15 2:33:39 Edited by kas1e on 2023/12/15 2:35:19 Edited by kas1e on 2023/12/15 2:57:37 Edited by kas1e on 2023/12/15 3:04:59 Edited by kas1e on 2023/12/15 3:19:39 Edited by kas1e on 2023/12/15 9:05:13 Edited by kas1e on 2023/12/15 9:06:22 Edited by kas1e on 2023/12/15 9:14:05 Edited by kas1e on 2023/12/15 10:56:42
|
|
|
|
Re: wb2filer v0.7
|
Posted on: 12/14 8:19
#84
|
Home away from home
|
@msteed Quote: Just noticed: When WB2Filer is running, switching the Workbench background from a backdrop window to a regular window and then back again causes a crash (a DSI in the OpenWindowTagList() patch). Perhaps because there's no window title?
Yeah exactly :) Already fixed just hold for next one (maybe Balaton will check if i introduce some crap code again:) )
|
|
|
|
Re: wb2filer v0.6
|
Posted on: 12/14 3:38
#85
|
Home away from home
|
@All New version ! Quote: v.07 (14.12.2023) -- totaly rewrote logic of patch: now instead of WB's WorkbenchControl() and manual icon selection,we simply based on window title names. This simplify patch a lot and make it work much better in all situations (thanks Joerg)
-- get rid of WFLG_BACKDROP check as struct *NewWindow never had WFLG_BACKDROP (joerg)
-- code cleaning by Balaton's suggestions (simplify DISK icon check, remove some nested ifs and indentation for readability, vars renaming, simplification of code, etc.)
-- added check on ActiveWindow to distinguish between main desktop and other windows more when want to have original Workbench windows while run wbrun from shell or from Filer's "Open Workbench"
-- added check on "Amiga+e" window (AsynWB - texinput process) : so when we hit "Amiga+e" we are able to do "wbrun" from it to have Original WB window.
-- rewrote README and made another version in true amiga.guide format
-- cosmetic fixes for the icons (thanks msteed for note)
There is: https://kas1e.mikendezign.com/aos4/wb2filer/WB2Filer_07.lha
Edited by kas1e on 2023/12/14 5:46:41
|
|
|
|
Re: wb2filer v0.6
|
Posted on: 12/13 17:50
#86
|
Home away from home
|
@joerg Quote: You are checking the wrong one again If NewWindow->Title
As always, you are right :) Yeah, now i have proper lines for: Quote: Task->tc_Node.ln_Name is Workbench It's WBENCHWINDOW nw->Title = RAM Disk 100% full, 0B free, 47.9KB in use Task->tc_Node.ln_Name is Workbench It's WBENCHWINDOW nw->Title = sfs2 63% full, 6,252.1MB free, 10.3GB in use Task->tc_Node.ln_Name is Workbench It's WBENCHWINDOW nw->Title = Work 38% full, 310.8GB free, 189.9GB in use Task->tc_Node.ln_Name is Workbench It's WBENCHWINDOW nw->Title = Public 1% full, 37.2GB free, 288.7MB in use Task->tc_Node.ln_Name is Workbench It's WBENCHWINDOW nw->Title = System 1% full, 198.3GB free, 2,237.3MB in use Task->tc_Node.ln_Name is Workbench It's WBENCHWINDOW nw->Title = morphos 0% full, 12.5GB free, 3,295KB in use
Now need to think about proper way to parse the disk names: as i see, there are 2 spaces between disk names and numbers, but then, there can be situation when a disk name by itself have many spaces in (2 or more), so to parse on just spaces is no way. And can't those "titles" be changed by GUI/workbench prefs by the way ? @All The easy way i go now is just:
// check if title of window have 2 spaces , at least one "," and one "%", then this is DISK.
if (!strstr(nw->Title," ") && !strstr(nw->Title,",") && !strstr(nw->Title,"%")) {
goto end;
}
// split string by first space separator and add ":" at end
char *icon_name;
icon_name = strtok(nw->Title, " ");
strcat(icon_name,":");
So all works fine, but then, we can't handle names with spaces, so no RAM DISK, but at least RAM: works too :) And question still are : what should we do in other 4 cases which is not dbl-clicks, i mean : when run wbrun from shell, when run wbrun from "amiga+e", and when call workbenchs "Open Volumes" and "Open". Imho we can keep filler for: 1)dbl-click 2). "Open Volumes" 3). "Open". But for 3 others like "amiga+e / wbrun" , "shell/wbrun" and "filler's open wb folder" - original WB window. What you think ?
Edited by kas1e on 2023/12/13 18:26:23 Edited by kas1e on 2023/12/13 18:31:02
|
|
|
|
Re: wb2filer v0.6
|
Posted on: 12/13 8:15
#87
|
Home away from home
|
@All So, that what we have: 1. When we dbl-click desktop disks : Quote: Task->tc_Node.ln_Name is Workbench It's WBENCHWINDOW ActiveWindow->Title = (null) ActiveWindow->node->ln_Name = Workbench WFLG_BACKDROP!
2. When we multiselect 2 icons, let's say RAM: and SFS2: and then dbl-click them, then: Quote: Task->tc_Node.ln_Name is Workbench It's WBENCHWINDOW ActiveWindow->Title = (null) ActiveWindow->node->ln_Name = Workbench WFLG_BACKDROP! Task->tc_Node.ln_Name is Workbench It's WBENCHWINDOW ActiveWindow->Title = RAM Disk 100% full, 0B free, 47.9KB in use ActiveWindow->node->ln_Name = Workbench
So null for first openwindowtaglist(), and then as opened window start to be active by default, title of already opened (auto-active) one. In other words, first icon = NULL for title (workbench's one), then second icon, title of the active window (which is one opened before). Dunno if we can use Title then somehow ? PS. found a way how to differ between workbench and amiga+e : by checking on the task name which is "AsyncWB - textinput", and deselect icons from desktop. It works, but not sure if localizations take place there or not, hope not. Also, we need to sort the things how it better to react, i mean what to do when: 1). when dbl-click on icon on desktop 2). when run "wbrun" from shell 3). when run "wbrun" from amiga+e 4). when do "open" for selected icon 5). when do "open volume" I think it should be like: 1). when dbl-click on icon on desktop - Filer 2). when run "wbrun" from shell - original WB window 3). when run "wbrun" from amiga+e - original WB window 4). when do "open" for selected icon - Filer 5). when do "open volume" - ? Just to sort it all how it should be, and then one by one, deal with.
Edited by kas1e on 2023/12/13 10:03:39 Edited by kas1e on 2023/12/13 10:04:17 Edited by kas1e on 2023/12/13 10:05:13
|
|
|
|
Re: wb2filer v0.6
|
Posted on: 12/12 18:47
#88
|
Home away from home
|
@joerg Quote: To check if something was called from the Workbench backdrop window you'd have to use (ActiveWindow->Flags & WFLG_BACKDROP) instead.
You were right as always, yeah, now i can see that WFLG_BACKDROP is set for Workbench. Do you aware of any way, how i can dereference when icon on the workbench selected (so active window is workbench) and then i hit "amiga+e" , and type there "wbrun something:", and while icon is selected on workbench, it's "workbench", but i need to detect somehow that with this "amiga+e/wbrun" combo it's not usual "click on workbench's desktop icon". Im not sure if it possible to trace a command from which OpenWindowTagList() were called ? Because when we do "amiga+e", all i have is : Quote: Task->tc_Node.ln_Name is AsyncWB - textinput process NW is NULL
So far looks good, but then, when i type there "wbrun ram:", it then: Quote: Task->tc_Node.ln_Name is Workbench It's WBENCHWINDOW ActiveWindow->node->ln_Name = Workbench WFLG_BACKDROP!
|
|
|
|
Re: wb2filer v0.6
|
Posted on: 12/12 12:20
#89
|
Home away from home
|
@All And i think we need to patch one more function : the one, which check if the workbench window is already opened or not.
Because as of now, we can be in this situation:
-- spawn original wb window by anything (wbrun from shell are ok), like for the RAM: -- now select on desktop RAM and second disk icon (work or whatever you have under the RAM one). -- dbl-click on any of them while both seelted.
Now, instead of opening just another disk by filer, it's instead open the same one we already opened and with keeping selected the selected icons do nothing, so i need to click another time, and then second disk opens and icons deselects.
I think issue there is that checking on the "if clicked disk already opened on screen or not" happens without involving of OpenWindowTagList(), so we just in mess a bit with our which_icon global flag : because it's 2 icons selected, but OpenWinowTagList() will be used just one time as the check on the "if window opened already" done not from OpenWindowTagList().
Have anyone an idea how to bypass this moment ?
ps. Btw, if we can find how Workbench checking on "if disk already opened on screen", we can then just avoid re-run of filer, and making it active instead.
|
|
|
|
Re: wb2filer v0.6
|
Posted on: 12/12 11:30
#90
|
Home away from home
|
@All Ok, i did small experiment with this test-patch to see how it behaves:
struct Window * APICALL Patched_OpenWindowTagList(struct IntuitionIFace *Self, const struct NewWindow * nw, const struct TagItem * tagList)
{
struct Task *Caller = (struct Task *)IExec->FindTask(NULL);
if (!Caller) {
IExec->DebugPrintF("Caller is NULL\n");
goto err;
}
if (!Caller->tc_Node.ln_Name) {
IExec->DebugPrintF("Caller->tc_Node.ln_Name is NULL\n");
goto err;
}
IExec->DebugPrintF("Caller->tc_Node.ln_Name is %s\n", Caller->tc_Node.ln_Name);
if (!nw) {
IExec->DebugPrintF("NW is NULL\n");
goto err;
}
if (nw->Flags & WFLG_WBENCHWINDOW) IExec->DebugPrintF("It's WBENCHWINDOW\n");
if (nw->Flags & WFLG_BACKDROP) IExec->DebugPrintF("It's WFLG_BACKDROP\n");
ULONG lock = IIntuition->LockIBase(0);
struct Window *ActiveWindow = ((struct IntuitionBase *)IntuitionBase)->ActiveWindow;
IIntuition->UnlockIBase(lock);
struct Node *node = NULL;
if(ActiveWindow->UserPort) {
node = (struct Node *)ActiveWindow->UserPort->mp_SigTask;
IExec->DebugPrintF("ActiveWindow->node->ln_Name = %s\n", node->ln_Name);
}
err:
return Original_OpenWindowTagList(Self,nw, tagList);
}
That what i have returned when dbl-click on RAM disk on Workbench Desktop: Quote: Caller->tc_Node.ln_Name is Workbench It's WBENCHWINDOW ActiveWindow->node->ln_Name = Workbench
That when i in the shell hit "tab" (for command competition window to spawn): Quote: Caller->tc_Node.ln_Name is CON/con-handler 53.82 NW is NULL
That, what i have when type in the shell "wbrun ram:": Quote: Caller->tc_Node.ln_Name is Workbench It's WBENCHWINDOW ActiveWindow->node->ln_Name = WinFrame 1 Process
That what i have when run Filer from AmiDock, and do "Open in workbench folder" from it: Quote: Caller->tc_Node.ln_Name is Workbench It's WBENCHWINDOW ActiveWindow->node->ln_Name = Background CLI
That what happens when i hit "amiga+e" for command line window to spawn in the center of screen: Quote: Caller->tc_Node.ln_Name is AsyncWB - textinput process NW is NULL
That what happens if i use "Open Volume" from the workbench: Quote: Caller->tc_Node.ln_Name is Workbench It's WBENCHWINDOW ActiveWindow->node->ln_Name = Workbench
That what we have when select an Icon and choose "Open" from workbench: Quote: Caller->tc_Node.ln_Name is Workbench It's WBENCHWINDOW ActiveWindow->node->ln_Name = Workbench
That what happens if i select RAM:, and in the shell type "wbrun work:" while RAM: keep selected: Quote: Caller->tc_Node.ln_Name is Workbench It's WBENCHWINDOW ActiveWindow->node->ln_Name = WinFrame 1 Process
So, firstly good thing: this "UserPort->mp_SigTask" for sure good one! Then, the thing i don't understand : So far, i didn't see anywhere at all that WFLG_BACKDROP is in place. Not when i click on Desktop's icons, not when i open any Workbench window. While all workbench windows have WBENCHWINDOW, but none of them have WFLG_BACKDROP. Maybe simple WFLG_BACKDROP is not work for OpenWindowTagList() and this is wrong to check like this, and should be used WA_Backdrop instead ? At least in the Wiki i find this: Quote: Backdrop windows are created by specifying the WFLG_BACKDROP flag or the WA_Backdrop tag in the OpenWindowTagList() call.
And if i use WA_Backdrop instead, then, for every opened workbench window i do have together with WBENCHWINDOW and BACKDROP printf too, but there again no differences in this terms : all windows which have WFLG_WBENCHWINDOW also have WA_Backdrop
|
|
|
|
Re: wb2filer v0.6
|
Posted on: 12/12 3:34
#91
|
Home away from home
|
@All Well, the check on the ActiveWindow LeftEdge + BorderTop are ok, but then, if i hit "amiga+e" and type "wbrun ram:", while "ram" selected on workbench, then it again run Filer instead of plain wb window because when we do it like this we have no window from which we run it...
Dunno if we need to do something about, or better to just wrote it to corner cases ?
And interesting issue with which_icon seems so still present : when we have opened on the workbench pure WB window for let's say "RAM:", and then multiselected RAM: and let's say WORK: and dbl-click on it, then, Workbench check that RAM: is already opened, and didn't open a Filer on (that ok), but then, it opens another disk you select also as pure WB one :)
In other words, when original WB window opened on some disk, and you tried to open that disk and some other one at the same time, then, then WB check if window already opened, and returned to the way which broke patch's logic
|
|
|
|
Re: Do we have fast, accelerated, bug-free, supporting scaling SNES emulator ?
|
Posted on: 12/11 8:56
#92
|
Home away from home
|
@Olle Quote: Yesterday i fixed the issue with black screen and also fixed the white border. I also added 3x and 4x scaling + scanlines and some more things. ... Going to do a complete backup now
Were you able to save the sources ? If not, maybe you can share the fix about white border ?:) Or if sources saved, maybe you can send latest version to Steffen ? Thanks !
|
|
|
|
Re: wb2filer v0.6
|
Posted on: 12/11 8:51
#93
|
Home away from home
|
@msteed Quote: Would it be sufficient to just check the active window for WFLG_WBENCHWINDOW and WFLG_BACKDROP? The Workbench backdrop window should be the only one that has both those flags set. And that's the only window where disk icons will be found.
As far as i test, and Filer and shell window both have same WFLG_WBENCHWINDOW and WFLG_BACKDROP flags. And btw this WFLG_BACKDROP is misleading by name : like, it's desktop's backdrop, but it's not: Quote: Backdrop Window Type Backdrop windows open behind all other non-backdrop windows, but in front of other backdrop windows that might already be open. Depth arrangement of a backdrop window affects the order of the window relative to other backdrop windows, but backdrop windows always stay behind all non-backdrop windows. No amount of depth arrangement will ever move a non-backdrop window behind a backdrop window.
The only system gadget that can be attached to a backdrop window is the closewindow gadget. Application gadgets are not restricted in backdrop windows.
Backdrop windows may often be used in place of drawing directly into the display memory of a custom screen. Such a technique is preferred, as backdrop windows are compatible with the Intuition windowing system. Using a backdrop window eliminates the danger of writing to the screen memory at a "bad" time or at the wrong position and overwriting data in a window.
To provide a full screen display area that is compatible with the windowing system, create a full sized, borderless, backdrop window with no system gadgets. Use the ShowTitle() call to hide or reveal the screen's title bar, as appropriate. See the SDK for a complete list of arguments for ShowTitle().
Backdrop windows are created by specifying the WFLG_BACKDROP flag or the WA_Backdrop tag in the OpenWindowTagList() call.
Quote: Though as I think about it, there is a actually a way to make both those methods fail: Open a non-disk icon, which will result in a normal Workbench drawer window. Now single-click a disk icon on the backdrop window to select it and make the backdrop window the active window. Click the border of the drawer window to make it the active window instead, without deselecting the icon. Now use the Workbench "Open" menu to open the selected icon. It will open as a regular Workbench window instead of as a Filer, since the active window is neither a backdrop window nor is at the left edge of the screen.
For me when i hit on the border of the window with opened WB drawer , it start to be active, and the selection from Workbench one unselects. But i think i find the way to reproduce what you mean, just a bit different: -- open RAM: via "wbrun" (or from Filer) -- now, while it casual wb window, just select 2 icons on desktop : RAM one, and any other one -- dbl-click on them, and while first window will not opens (that clear, as RAM already opened) it will open in the same casual window a next disk, and not in Filer's mode. Some more check need it seems so ? @Joerg Yeah, thanks! ActiveWindow->BorderTop is surely better. All active windows i test so far always have in my case BorderTop = 25, and only when Workbench Desktop window active it says 0. But then, it also says 0 for BorderTop too, so maybe something like:
ULONG lock = IIntuition->LockIBase(0);
int BorderTop = ((struct IntuitionBase *)IntuitionBase)->ActiveWindow->BorderTop;
int LeftEdge = ((struct IntuitionBase *)IntuitionBase)->ActiveWindow->LeftEdge;
IIntuition->UnlockIBase(lock);
if ( BorderTop != 0 && LeftEdge !=0) goto end;
?
Edited by kas1e on 2023/12/11 9:08:58
|
|
|
|
Re: wb2filer v0.6
|
Posted on: 12/11 2:58
#94
|
Home away from home
|
@balaton Yeah, thanks! There is current version: https://kas1e.mikendezign.com/aos4/wb2filer/WB2Filer_pre07_v2.c@All Through i am not sure about if it enough to just check LeftEdge of ActiveWindow != 0 to distinguish between main desktop and other windows , but at least the only situation when it will not work, is when user will move the window exactly on the 0 and somehow keep selected some icons. Probably will not happen, or so rare, that can be left as it ? Of course, i can get the size of the workbench desktop, and compare with another Edge, but then, it will add unnecessary complexity IMHO. And actually situation when someone will select more than one icon, but not clicking on, and then running shell or filer, and specially move it to the edge 0 of desktop (while keep icons on selected), probably will be never happens. At least it surely better to have it as very rare corner case (and note in readme about) in compare with adding more complexity and have other bugs with.
Edited by kas1e on 2023/12/11 3:21:54
|
|
|
|
Re: wb2filer v0.6
|
Posted on: 12/10 16:52
#95
|
Home away from home
|
@SpotUP Quote: Can filer itself be made resident? There is an annoying delay the first time you open it.
On what hardware you have delay ? On all my real amigas i have no delay when run it (peg2, sam460, x1000 or x5000). Through there are a bit of micro-delay because it throws on sereal for every run that:
ListBrowserBase(HAS_NEWCOLUMNS): Test: 53.38 Has: 53.79 <- AVAILABLE
LayoutBase(HAS_NEWLAYOUT): Test: 53.0 Has: 54.10 <- AVAILABLE
BitMapBase(HAS_ALPHABITMAP): Test: 53.6 Has: 53.9 <- AVAILABLE
GraphicsBase(HAS_COMPOSITION): Test: 53.0 Has: 54.252 <- AVAILABLE
InitColors
But that happens for every run. Seems when Orgin upload latest version forget to disable debug output, but that anyway give a very little micros-pause, dunno why you have noticeable delay ..
|
|
|
|
Re: wb2filer v0.6
|
Posted on: 12/10 13:06
#96
|
Home away from home
|
@msteed Do some tests, and manually checked the caller of the shell and of Filer's "workbench folder", and it is the same Workbench in each case indeed. Also, all the windows (and our workbench one, and shell one, and Filer's one) are of WFLG_WBENCHWINDOW type and of not of WFLG_BACKDROP. That why check is passed even when we run from shell or filer. So or we need to find a flag which only workbench use and no other windowss (then it will be easy right after mass selection happens and stays as it, to check if it anything than wb, and if yes, then skip it and open original window instead with return). Or, we can go another way which i checked now : we can take AtiveWindow, and check if LeftEdge, etc are more than 0 (as WB is 0 by left Edge) then it's other windows. I checked this way now, and it works fine : even if you select icons on desktop, if you run from any other window call to OpenWindowTagList, it will open original wb window, which is what we need. And even no "unselection" happens after, which is good too. Currently like this:
...
struct List *selList = NULL;
if ((IWorkbench->WorkbenchControl(NULL, WBCTRLA_GetSelectedIconList, &selList, TAG_DONE)) == FALSE) {
return Original_OpenWindowTagList(Self,nw, tagList);
}
ULONG lock = IIntuition->LockIBase(0);
int LeftEdge = ((struct IntuitionBase *)IntuitionBase)->ActiveWindow->LeftEdge;
IIntuition->UnlockIBase(lock);
if ( LeftEdge > 0) goto end;
// a bit of error checking to avoid unexpected crashes if no icons are selected.
...
But this need to think about careful, add more Edges to check, etc. Or maybe find a Flag which only desktop window have. Alternatively, we can on the first ever run of OpenWindwoTagList(), find the first window in the whole list of windows (which is workbench one), save the address globally, and then compare each time when mass selection happens if this one is active one or not.
Edited by kas1e on 2023/12/10 13:41:03 Edited by kas1e on 2023/12/11 2:33:55
|
|
|
|
Re: wb2filer v0.6
|
Posted on: 12/10 5:39
#97
|
Home away from home
|
@msteed The more easy way to reproduce this issue with "open one by one", is by doing this:
1. after running the patch, just select RAM icon (just one enough). 2. open shell, and type "wbrun work:"
Instead of open the "work" in usual wb window, it will open for us Ram disk in Filer, because icon is selected :) Then it unselects automatically, and next "wbrun work:" open work in usual wb window as expected.
IMHO, we need to find a proper way to somehow dirreference between actual running of OpneWindwoTagList() even more than just WB/WBBACKDROP/etc. Maybe something about "active/non active" windows ? Like:
-- is "wb backdrop window active when we do selectlist ? -- if yes, do all as before -- if no, then it mean we tried from Filer or from Shell with wbrun, so then deselect them firstly.
This should fix all issues we had (imho)
|
|
|
|
Re: wb2filer v0.6
|
Posted on: 12/10 4:31
#98
|
Home away from home
|
@msteed Quote: I noticed that with the previous version too, when I told the Grim Reaper to ignore the crash. Try resetting which_icon to zero when GetSucc() returns NULL; it may just be getting stuck at some non-zero value, which causes opening of a single icon to always fail.
Almost :) At least now after this steps: 1. dbl-click icon, filer opens 2. select 2 icons on desktop, in filer hit "workbench folder" 3. close filers, deselect icons. 4. click on any icon on desktop I have one time original WB window, all other clicks are working now. Seems resetting should be done early somehow as well. But i fear it also because of "filer run it once", and which icon counter mess a bit.
|
|
|
|
Re: wb2filer v0.6
|
Posted on: 12/10 3:50
#99
|
Home away from home
|
@msteed Quote: Technically, Filer doesn't call OpenWindowTagList() itself, it asks Workbench to open the window and then Workbench calls OpenWindowTagList(). But still only once, since Filer only asked it to open one window.
Right, so that what we kind of expect then and can keep it as it, right ? But this one: Quote: This is also a place where not checking for NULL in the GetSucc() loop can cause a crash. Double click a disk icon to open a Filer. Now shift-single-click two disk icons to select them. Use Lister->Workbench Folder from Filer to open a Filer for the first of the two selected icons. which_icon is now set to 1, to process the second icon in the list next time. Now click the Workbench backdrop to deselect all the icons, then single-click to select only one icon. Use Lister->Workbench Folder again. Boom. Or at least, sometimes boom. Sometimes the patch just stops working.
While not crashes anymore, it still produces a strange side effect : after this combo, every click on disk icons on workbench runs in original window mode _always_ :) like it trash something somewhere and patch stop working correctly. I.e. i just do this: 1. dbl-click icon, filer opens 2. select 2 icons on desktop, in filer hit "workbench folder" 3. close filers, deselect icons. 4. click on any icon on desktop => always original WB window.
|
|
|
|
Re: wb2filer v0.6
|
Posted on: 12/10 2:45
#100
|
Home away from home
|
@Rigo Quote: And the more complex you get inside a seriously critical function like OpenWindowTagList(), the worse the experience for the user.
I think you are right, need to fix remain bugs and leave it as it. @khayoz Quote: WB2Filer is standard in my setup now, I run it from User-Startup. Thank you! And of course big thanks to Björn Hagström for Filer!
Yeah, Filer good for sure. @balaton, msteed Thanks for all the suggestions/notes : deal with everything, but struggling with some issue left which i can't understand why it happens now. That what happens: 1. dbl-click on icon , filler runs. 2. select 2 icons on desktop 3. in the filer (while icons selected), hit "Workbench folder". Now, we have only open one of the disks. While selected 2 of them, and i expected 2 of them to be opened. If i printf "which_icon" count right after SystemTagList(), then for this case i do have "which_icon = 0". Like, selection didn't happen correctly by some reasons when i hit in Filer "workbench folder". But hitting by dbl-click on those 2 selected icons, works fine, and open 2 of them. There is just current source, check this out, maybe you will spot an obvious issue: https://kas1e.mikendezign.com/aos4/wb2filer/WB2Filer_pre07.c
|
|
|
|