Problem with xfig
Hi, I think I found the problem with xfig about icon title and border. The problem seems to be that icon->icon_win is not NULL :-) If we comment these lines all was fine: ---8<-- if (wwin->wm_hints && (wwin->wm_hints->flags & IconWindowHint)) { if (wwin->client_win == wwin->main_window) { WApplication *wapp; /* do not let miniwindow steal app-icon's icon window */ wapp = wApplicationOf(wwin->client_win); // if (!wapp || wapp->app_icon == NULL) // icon->icon_win = wwin->wm_hints->icon_window; } else { // icon->icon_win = wwin->wm_hints->icon_window; } } ---8<-- These code was there, but I am not sure if we can drop it? I tried other apps, and all was fine. Please, help. Best regards, kix -- ||// //\\// Rodolfo "kix" Garcia ||\\// //\\ http://www.kix.es/ -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: Problem with xfig
On Sat, 24 Nov 2012, Rodolfo García Peñas wrote: The problem seems to be that icon->icon_win is not NULL :-) That's not a problem. Some apps may have an icon window instead of a static icon (maybe they want to display something in the icon). Rather the problem might be that it is not ignored when the ignore client supplied icon option is set. These code was there, but I am not sure if we can drop it? I tried other apps, and all was fine. Not sure either but you could try the attached test case (and check that minimising the window is OK too as the comment suggests that it may have something to do with that). Regards, BALATON Zoltan#include #include #include #include Display *d; Window leader, mainwin, win; XClassHint class_hint = { "wmicontest", "WMIconTest" }; int main(int argc, char **argv) { int ret; XWMHints hints; d = XOpenDisplay(NULL); if ( !d ) { fprintf(stderr,"Cannot open display: %s\n", XDisplayName(NULL)); exit(EXIT_FAILURE); } printf("Opened display %s\n", DisplayString(d)); /* Create the leader window */ leader = XCreateSimpleWindow(d, /* Display */ DefaultRootWindow(d), /* Parent */ 10, 10, /* x, y */ 10, 10, /* width, height */ 0, /* border_width */ BlackPixel(d, DefaultScreen(d)), /* border */ WhitePixel(d, DefaultScreen(d))); /* background */ printf("XCreateSimpleWindow returned: %lx\n", leader); /* Create the main window */ mainwin = XCreateSimpleWindow(d, /* Display */ DefaultRootWindow(d), /* Parent */ 0, 0, /* x, y */ 56, 56, /* width, height */ 0, /* border_width */ BlackPixel(d, DefaultScreen(d)), /* border */ WhitePixel(d, DefaultScreen(d))); /* background */ printf("XCreateSimpleWindow returned: %lx\n", mainwin); /* Set hints */ XSetClassHint(d, leader, &class_hint); hints.flags = StateHint|WindowGroupHint|IconWindowHint; hints.initial_state = WithdrawnState; hints.window_group = leader; hints.icon_window = mainwin; /* Use the main window as the icon window */ XSetWMHints(d, leader, &hints); XSetClassHint(d, mainwin, &class_hint); hints.flags = StateHint|WindowGroupHint; hints.initial_state = NormalState; XSetWMHints(d, mainwin, &hints); ret = XMapWindow(d, leader); printf("XMapWindow returned: %x\n", ret); XSync(d, False); getchar(); /* Create a window */ win = XCreateSimpleWindow(d, /* Display */ DefaultRootWindow(d), /* Parent */ 100, 100, /* x, y */ 100, 100, /* width, height */ 0, /* border_width */ BlackPixel(d, DefaultScreen(d)), /* border */ WhitePixel(d, DefaultScreen(d))); /* background */ printf("XCreateSimpleWindow returned: %lx\n", win); /* Set hints */ XSetClassHint(d, win, &class_hint); XSetWMHints(d, win, &hints); ret = XMapRaised(d, win); printf("XMapRaised returned: %x\n", ret); XSync(d, False); getchar(); XCloseDisplay(d); return(EXIT_SUCCESS); }
Re: Problem with xfig
On Sat, 24 Nov 2012, BALATON Zoltan escribió: > On Sat, 24 Nov 2012, Rodolfo García Peñas wrote: > >The problem seems to be that icon->icon_win is not NULL :-) > > That's not a problem. Some apps may have an icon window instead of a > static icon (maybe they want to display something in the icon). > Rather the problem might be that it is not ignored when the ignore > client supplied icon option is set. > > >These code was there, but I am not sure if we can drop it? > >I tried other apps, and all was fine. > > Not sure either but you could try the attached test case (and check > that minimising the window is OK too as the comment suggests that it > may have something to do with that). > > Regards, > BALATON Zoltan Hi, I am not sure if the testing application is working. The application only show a dock (miniwindow) with a white square inside. kix@osaka:~/src/wmaker/wmaker-crm/src$ /home/kix/wmicontest Opened display :1 XCreateSimpleWindow returned: 341 XCreateSimpleWindow returned: 342 XMapWindow returned: 1 If I run it with the lines commented, then the application doesn't have the white square. Regards, kix -- ||// //\\// Rodolfo "kix" Garcia ||\\// //\\ http://www.kix.es/ -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: Problem with xfig
On Sun, 25 Nov 2012, Rodolfo García Peñas wrote: I am not sure if the testing application is working. The application only show a dock (miniwindow) with a white square inside. kix@osaka:~/src/wmaker/wmaker-crm/src$ /home/kix/wmicontest Opened display :1 XCreateSimpleWindow returned: 341 XCreateSimpleWindow returned: 342 XMapWindow returned: 1 Read it before you run it! Press enter to move on to the next step when it opens a window. You can try to minimise it. Then press enter again (in the terminal you've started it from) to finish. If I run it with the lines commented, then the application doesn't have the white square. That means it would break apps which display something in their appicon. Did you try dockapps? (The white square is the icon window.) Regards, BALATON Zoltan
Re: Problem with xfig
On Sun, 25 Nov 2012, BALATON Zoltan escribió: > On Sun, 25 Nov 2012, Rodolfo García Peñas wrote: > >I am not sure if the testing application is working. > >The application only show a dock (miniwindow) with a > >white square inside. > > > >kix@osaka:~/src/wmaker/wmaker-crm/src$ /home/kix/wmicontest > >Opened display :1 > >XCreateSimpleWindow returned: 341 > >XCreateSimpleWindow returned: 342 > >XMapWindow returned: 1 > > Read it before you run it! Press enter to move on to the next step > when it opens a window. You can try to minimise it. Then press enter > again (in the terminal you've started it from) to finish. > > >If I run it with the lines commented, then the application > >doesn't have the white square. > > That means it would break apps which display something in their > appicon. Did you try dockapps? (The white square is the icon > window.) The problem is because the "icon->icon_win == None". See the wIconUpdate function at [1]. This function is different than the next branch, I did a lot of changes, but the idea is the same. See the flow with the removed lines: icon_create_for_wwindow set_icon_for_window: wIconUpdate wIconUpdate icon 0x936cd0 wwin 0x93f000 flag 0 wIconUpdate:get_rimage_icon_from_user_icon 4 icon 0x936cd0 wIconUpdate icon 0x936cd0 wwin 0x93f000 flag 0 wIconUpdate:get_rimage_icon_from_user_icon 4 icon 0x936cd0 Or with the lines (original code/next code): icon_create_for_wwindow set_icon_for_window: wIconUpdate wIconUpdate icon 0x19bfd30 wwin 0x19c1a90 flag 0 wIconUpdate:get_rimage_icon_from_icon_win 2 icon 0x19bfd30 wIconUpdate icon 0x19bfd30 wwin 0x19c1a90 flag 0 wIconUpdate:get_rimage_icon_from_icon_win 2 icon 0x19bfd30 If I remove the lines, then "icon->icon_win == None", and then jump to the default icon. Else, get the icon from the wm_hints/net_icon_image. About your question about dockapps, they are fine here. Why? Dockapps works in a extrange way. The try to get the image for their dock. If the image is found, then, they set the image, else, set the wmaker default image. Whats happend if the application is running, then, the application background is set to the tile background (grey/blue/...), and the put the application inside the icon. But it the application is not running, the icon for the application is painted. If you click on the dockapp, the icon image is removed, the background is set and the application is put inside the icon. Regards, kix [1] void wIconUpdate(WIcon *icon, RImage *image) { WWindow *wwin = NULL; printf("wIconUpdate icon %p\n", icon); if (image) { icon->file_image = image; } else { if (icon && icon->owner) wwin = icon->owner; if (wwin) printf("wwin %p flag %d\n", wwin, WFLAGP(wwin, always_user_icon)); if (wwin && WFLAGP(wwin, always_user_icon)) { /* Forced use user_icon */ printf("wIconUpdate:get_rimage_icon_from_user_icon 1 icon %p\n", icon); get_rimage_icon_from_user_icon(icon); } else if (icon->icon_win != None) { /* Free the icon info */ unset_icon_image(icon); /* Get the Pixmap from the WIcon's Window */ printf("wIconUpdate:get_rimage_icon_from_icon_win 2 icon %p\n", icon); icon->file_image = get_rimage_icon_from_icon_win(icon); } else if (wwin && wwin->net_icon_image) { /* Remove the icon image */ unset_icon_image(icon); /* Get the icon from wwin->net_icon_image. * wwin->net_icon_image is NULL only if no icon was * found. Then, return the default image */ printf("wIconUpdate:get_window_image_def 3 icon %p\n", icon); icon->file_image = get_window_image_def(wwin); } else { /* Get the Pixmap from the user */ printf("wIconUpdate:get_rimage_icon_from_user_icon 4 icon %p\n", icon); get_rimage_icon_from_user_icon(icon); } } update_icon_pixmap(icon); } -- ||// //\\// Rodolfo "kix" Garcia ||\\// //\\ http://www.kix.es/ -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: Problem with xfig
On Sun, 25 Nov 2012, Rodolfo García Peñas wrote: The problem is because the "icon->icon_win == None". See the wIconUpdate function at [1]. This function is different than the next branch, I did a lot of changes, but the idea is the same. See the flow with the removed lines: icon_create_for_wwindow set_icon_for_window: wIconUpdate wIconUpdate icon 0x936cd0 wwin 0x93f000 flag 0 wIconUpdate:get_rimage_icon_from_user_icon 4 icon 0x936cd0 wIconUpdate icon 0x936cd0 wwin 0x93f000 flag 0 wIconUpdate:get_rimage_icon_from_user_icon 4 icon 0x936cd0 Or with the lines (original code/next code): icon_create_for_wwindow set_icon_for_window: wIconUpdate wIconUpdate icon 0x19bfd30 wwin 0x19c1a90 flag 0 wIconUpdate:get_rimage_icon_from_icon_win 2 icon 0x19bfd30 wIconUpdate icon 0x19bfd30 wwin 0x19c1a90 flag 0 wIconUpdate:get_rimage_icon_from_icon_win 2 icon 0x19bfd30 If I remove the lines, then "icon->icon_win == None", and then jump to the default icon. Else, get the icon from the wm_hints/net_icon_image. I didn't understand a word from this but I hope you understand and know what you are doing. Just make sure that the test application still works the same after your changes please. About your question about dockapps, they are fine here. Why? I was asking because they work the same as the test case I've sent (start in withdrawn state and use their window as an icon window). Dockapps works in a extrange way. The try to get the image for their dock. If the image is found, then, they set the image, else, set the wmaker default image. Whats happend if the application is running, then, the application background is set to the tile background (grey/blue/...), and the put the application inside the icon. But it the application is not running, the icon for the application is painted. If you click on the dockapp, the icon image is removed, the background is set and the application is put inside the icon. What if the dockapp is not yet docked but started from the command line? Regards, BALATON Zoltan
Re: Problem with xfig
On Sun, 25 Nov 2012, BALATON Zoltan escribió: > On Sun, 25 Nov 2012, Rodolfo García Peñas wrote: > >The problem is because the "icon->icon_win == None". See the > >wIconUpdate function at [1]. This function is different than the > >next branch, I did a lot of changes, but the idea is the same. See > >the flow with the removed lines: > > > >icon_create_for_wwindow > >set_icon_for_window: wIconUpdate > >wIconUpdate icon 0x936cd0 > >wwin 0x93f000 flag 0 > >wIconUpdate:get_rimage_icon_from_user_icon 4 icon 0x936cd0 > >wIconUpdate icon 0x936cd0 > >wwin 0x93f000 flag 0 > >wIconUpdate:get_rimage_icon_from_user_icon 4 icon 0x936cd0 > > > >Or with the lines (original code/next code): > > > >icon_create_for_wwindow > >set_icon_for_window: wIconUpdate > >wIconUpdate icon 0x19bfd30 > >wwin 0x19c1a90 flag 0 > >wIconUpdate:get_rimage_icon_from_icon_win 2 icon 0x19bfd30 > >wIconUpdate icon 0x19bfd30 > >wwin 0x19c1a90 flag 0 > >wIconUpdate:get_rimage_icon_from_icon_win 2 icon 0x19bfd30 > > > >If I remove the lines, then "icon->icon_win == None", and then > >jump to the default icon. Else, get the icon from the > >wm_hints/net_icon_image. > > I didn't understand a word from this but I hope you understand and > know what you are doing. Just make sure that the test application > still works the same after your changes please. I added some printfs in some functions to see the flow when an icon is created. The function wIconUpdate, at icon.c, changes the file_image of the icon, using different methods (from file, from wm_hints,...). If we removes the lines, the flow is different. I don't have nothing in mind. No changes. I only see that the problem is that or something related to these code lines. They changes how the application changes try to find the icon. > >About your question about dockapps, they are fine here. Why? > > I was asking because they work the same as the test case I've sent > (start in withdrawn state and use their window as an icon window). Ok, I don't know. > >Dockapps works in a extrange way. The try to get the image for > >their dock. If the image is found, then, they set the image, else, > >set the wmaker default image. Whats happend if the application is > >running, then, the application background is set to the tile > >background (grey/blue/...), and the put the application inside the > >icon. But it the application is not running, the icon for the > >application is painted. If you click on the dockapp, the icon > >image is removed, the background is set and the application is put > >inside the icon. > > What if the dockapp is not yet docked but started from the command line? The normal flow in wmaker is that the application is standar, with a appicon. Is a normal application. When you move the appicon to the dockthen the functions about docking adds the icon to the dock. Then set the icons,.. > Regards, > BALATON Zoltan Thanks for your reply. But I don't know what to do now. Best regards, kix -- ||// //\\// Rodolfo "kix" Garcia ||\\// //\\ http://www.kix.es/ -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: Problem with xfig
On Mon, 26 Nov 2012, Rodolfo García Peñas wrote: Thanks for your reply. But I don't know what to do now. I don't know either. Are there any problems you know about that should be fixed or everything is fixed now? I've lost track. Regards, BALATON Zoltan
Re: Problem with xfig
On Mon, 26 Nov 2012, BALATON Zoltan escribió: > On Mon, 26 Nov 2012, Rodolfo García Peñas wrote: > >Thanks for your reply. But I don't know what to do now. > > I don't know either. Are there any problems you know about that > should be fixed or everything is fixed now? I've lost track. No, is not fixed and I don't know how to fix it. Is only that these lines I commented, are the difference between icon and not icon, but I don't know how they impact in the code. Regards, kix > Regards, > BALATON Zoltan -- ||// //\\// Rodolfo "kix" Garcia ||\\// //\\ http://www.kix.es/ -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: Problem with xfig
On Mon, 26 Nov 2012, Rodolfo García Peñas wrote: No, is not fixed and I don't know how to fix it. What is not fixed? Could you make a list of problems that are still there and those that are already fixed. After all those patches you've sent I'm not sure what was fixed and what's still there. I reported these problems: - minimising and restoring window results in X error RenderBadPicture (maybe only if the Render extension is enabled) - ignore client supplied icon is not respected for some applications (e.g. xfig) - Apply button in window inspector did nothing I also reported clipped icons if they were too big but that's fixed (and drifting windows of apps which try to restore their position that I hope Iain is looking at but not fixed yet). Is only that these lines I commented, are the difference between icon and not icon, but I don't know how they impact in the code. I could not parse this sentence. Can you explain? Regards, BALATON Zoltan
Re: Problem with xfig
On 2012-11-26 11:10, BALATON Zoltan wrote: On Mon, 26 Nov 2012, Rodolfo García Peñas wrote: No, is not fixed and I don't know how to fix it. What is not fixed? Could you make a list of problems that are still there and those that are already fixed. After all those patches you've sent I'm not sure what was fixed and what's still there. I reported these problems: - minimising and restoring window results in X error RenderBadPicture (maybe only if the Render extension is enabled) - ignore client supplied icon is not respected for some applications (e.g. xfig) - Apply button in window inspector did nothing Hi! did you try the current "next" branch? This problem is not fully solved, but I think the button does things. Thanks. I also reported clipped icons if they were too big but that's fixed (and drifting windows of apps which try to restore their position that I hope Iain is looking at but not fixed yet). Is only that these lines I commented, are the difference between icon and not icon, but I don't know how they impact in the code. I could not parse this sentence. Can you explain? Regards, BALATON Zoltan -- ||// //\\// Rodolfo "kix" Garcia ||\\// //\\ http://www.kix.es/ -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: Problem with xfig
On Tue, 27 Nov 2012, Rodolfo García Peñas (kix) wrote: did you try the current "next" branch? This problem is not fully solved, but I think the button does things. I'm running the next branch and it's not working correctly. Here's what I see: 1. Start xcalc and open Icon and Initial Workspace inspector you probably will see the icon pointing to a file in the cache and the Ignore client supplied icon option ticked 2. Delete the file name from the text field and untick the Ignore option then click save and check that there is no section now for XCalc in WMWindowAttributes. This should be the initial state when an application is first run. Now you can continue testing. 3. Close xcalc then start it again and see what happened in the inspector. Also check what's in WMWindowAttributes and note that the Ignore attribute is not consistent. (It is checked in the GUI but not set in the config.) All this should not happen as the cached image should not be added to the config file at the first place but let's continue testing. 4. Uncheck the Ignore option in the inspector and try to select an icon then click apply. See that nothing happens. 5. Click save, the icon has changed now in the appicon and also set in the config file but try to minimise the window and see that the miniwindow does not have the correct icon. 6. Now just close the app and restart it. Try minimising the window and the icon is now also set in the miniwindow. Check the inspector and see that the Ignore option is magically ticked now while it's still not set in WMWindowAttributes. I think there are still some things left to fix to untangle this mess as this cannot be the correct behaviour. Most of this seems to be some breakage of the Ignore client supplied icon option. Regards, BALATON Zoltan
Re: Problem with xfig
On Tue, 27 Nov 2012, BALATON Zoltan escribió: > On Tue, 27 Nov 2012, Rodolfo García Peñas (kix) wrote: > >did you try the current "next" branch? This problem is not fully > >solved, but I think the button does things. > > I'm running the next branch and it's not working correctly. Here's > what I see: > > 1. Start xcalc and open Icon and Initial Workspace inspector you > probably will see the icon pointing to a file in the cache and the > Ignore client supplied icon option ticked > > 2. Delete the file name from the text field and untick the Ignore > option then click save and check that there is no section now for > XCalc in WMWindowAttributes. This should be the initial state when > an application is first run. Now you can continue testing. > > 3. Close xcalc then start it again and see what happened in the > inspector. Also check what's in WMWindowAttributes and note that the > Ignore attribute is not consistent. (It is checked in the GUI but > not set in the config.) All this should not happen as the cached > image should not be added to the config file at the first place but > let's continue testing. > > 4. Uncheck the Ignore option in the inspector and try to select an > icon then click apply. See that nothing happens. > > 5. Click save, the icon has changed now in the appicon and also set > in the config file but try to minimise the window and see that the > miniwindow does not have the correct icon. > > 6. Now just close the app and restart it. Try minimising the window > and the icon is now also set in the miniwindow. Check the inspector > and see that the Ignore option is magically ticked now while it's > still not set in WMWindowAttributes. > > I think there are still some things left to fix to untangle this > mess as this cannot be the correct behaviour. Most of this seems to > be some breakage of the Ignore client supplied icon option. > > Regards, > BALATON Zoltan Hi, I think these issues are solved with the patches I sent. Please, take a look about the issue with the window icon, because the window only has icon if is minimized. The configuration file is fine too. I don't know if this new behavior is ok for you. Best regards, kix -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.