Borderless form doesn't minimize on ubuntu. lazarus / 32-Linux ---------------------------------------------------------------------- georgebou · 2014-02-10 16:41 Hi guys and administrators. I have made a simple example to show you a problem i have. While this code works on windows correctly, it doesn't on ubuntu 12.04 LTS with unity. When you click the minimize button and the form is borderless (style = bsnone) the form doesn't minimize on ubuntu but it does on windows. If you change the style to bssizeable it works fine on both platforms. The question is the following: a. Is it a lazarus bug on ubuntu, or an ubuntu "problem" and i should stop trying to find a solution? b. Can anyone tell me if this code works on a KDE enviroment? ---------------------------------------------------------------------- zeljko · 2014-02-10 19:00 I'm not sure that it's possible to "minimize" frameless form under X11.You can hide it. ---------------------------------------------------------------------- georgebou · 2014-02-12 21:02 Quote from: zeljko on February 10, 2014, 08:00:54 pmI'm not sure that it's possible to "minimize" frameless form under X11.You can hide it. If you hide it it doesn't show on launch bar. ---------------------------------------------------------------------- Leledumbo · 2014-02-13 14:39 Quoteb. Can anyone tell me if this code works on a KDE enviroment?Nope, neither with gtk2 nor qt. I guess it's by design. Gotta wait until Wayland replaces X11 and see if it could work in Wayland (you could try Wayland already AFAIK, but I don't want to mess my system by installing it now). ---------------------------------------------------------------------- georgebou · 2014-02-13 15:29 Quote from: Leledumbo on February 13, 2014, 03:39:46 pmQuoteb. Can anyone tell me if this code works on a KDE enviroment?Nope, neither with gtk2 nor qt. I guess it's by design. Gotta wait until Wayland replaces X11 and see if it could work in Wayland (you could try Wayland already AFAIK, but I don't want to mess my system by installing it now). Ok thank you very much. The main idea is to make it work on  a typical linux system, and some popular distributions use X11. Thank you all. ---------------------------------------------------------------------- Rails · 2014-02-13 15:47 I can't think of any that don't use X11 at the moment. Out of curiosity, why do you need a borderless form? ---------------------------------------------------------------------- georgebou · 2014-02-13 17:39 Quote from: Rails on February 13, 2014, 04:47:41 pmI can't think of any that don't use X11 at the moment. Out of curiosity, why do you need a borderless form? i have made this audio player for windows with Delphi. http://www.passionplayer.com After 10 years and of course because lazarus became a mature pascal and delphi programming environment i decided to transfer my audio player first to linux and then to macos. While 95% of the code transfer is completed, some details that are important to me prevent me from releasing it for linux. One of them is the borderless forms. Check the photo on my site and you will see what i mean ---------------------------------------------------------------------- georgebou · 2014-02-22 13:46 After i made more research it seems to be a gtk bug. I will try to find a workaround for it but so far all my solutions are not working. ---------------------------------------------------------------------- Rails · 2014-02-22 14:26 I don't know if this will help or not. You could try switching to QT for your Linux version. QT does allow you to have borderless forms. Out of curiosity, I tried it with the application I am currently developing, since I target QT. Everything worked except the part about the form minimizing to the task bar. Instead, it simply minimized to thin air.  However, I was able to bring it back under program control, so it wasn't a crash and may be something you could use after further investigation. ---------------------------------------------------------------------- georgebou · 2014-02-22 20:23 Yea it's not a crash. You just can't see the form on the taskbar so that you restore it. ---------------------------------------------------------------------- zeljko · 2014-02-22 22:13 Let's mention it once again: X11 doesn't allow to minimize borderless forms into tray (not Qt and not Gtk is guilty for that). Use tray icon + borderless form that will fix your problem. ---------------------------------------------------------------------- georgebou · 2014-02-23 00:18 Quote from: zeljko on February 22, 2014, 11:13:19 pmLet's mention it once again: X11 doesn't allow to minimize borderless forms into tray (not Qt and not Gtk is guilty for that). Use tray icon + borderless form that will fix your problem. But i directly called the gdk_window_iconify function and it didn't do the job for the frameless from. So the problem starts from gdk. And the main problem for me is that i have to minimize 5 windows with one minimize call. So it is more complicated. ---------------------------------------------------------------------- Rails · 2014-02-23 01:30 Can you put a custom icon in the tray? I've never tried, but it should be doable. Minimize the borderless form, and have the tray icon appear under program control. When the user clicks on the icon, normalize the form (set its WindowState property to wsNormal, again under program control. I think this is what zeljko is suggesting. ---------------------------------------------------------------------- georgebou · 2014-02-23 11:20 Quote from: Rails on February 23, 2014, 02:30:28 amCan you put a custom icon in the tray? I've never tried, but it should be doable. Minimize the borderless form, and have the tray icon appear under program control. When the user clicks on the icon, normalize the form (set its WindowState property to wsNormal, again under program control. I think this is what zeljko is suggesting. I will try it and i am also trying various other tricks like changing start fro bsnone to bssizeable, minimize and the restore it somehow. If i come to a proper solution i will post it here ---------------------------------------------------------------------- zeljko · 2014-02-23 16:59 Quote from: georgebou on February 23, 2014, 01:18:26 amBut i directly called the gdk_window_iconify function and it didn't do the job for the frameless from. So the problem starts from gdk. And the main problem for me is that i have to minimize 5 windows with one minimize call. So it is more complicated. What part of sentence " X11 doesn't allow to minimize borderless forms into tray (not Qt and not Gtk is guilty for that)." you did not understand ? ---------------------------------------------------------------------- georgebou · 2014-02-23 18:47 Quote from: zeljko on February 23, 2014, 05:59:04 pmQuote from: georgebou on February 23, 2014, 01:18:26 amBut i directly called the gdk_window_iconify function and it didn't do the job for the frameless from. So the problem starts from gdk. And the main problem for me is that i have to minimize 5 windows with one minimize call. So it is more complicated. What part of sentence " X11 doesn't allow to minimize borderless forms into tray (not Qt and not Gtk is guilty for that)." you did not understand ? The part i don't understand is the following. The reason that gdk_window_iconify function doesn't minimize borderless forms is that X11 limits it or that gdk function doesn't make it happen for borderless forms? ---------------------------------------------------------------------- zeljko · 2014-02-23 19:37 Quote from: georgebou on February 23, 2014, 07:47:27 pmThe part i don't understand is the following. The reason that gdk_window_iconify function doesn't minimize borderless forms is that X11 limits it or that gdk function doesn't make it happen for borderless forms? Yes. You have solutions like I already mentioned: use TrayIcon, or use some normal form as mainform and keep it minimized all the time (so it's visible in tray). ---------------------------------------------------------------------- georgebou · 2014-02-23 19:43 Ok thanks, i got it now.