Recent

Author Topic: Borderless form doesn't minimize on ubuntu.  (Read 15196 times)

georgebou

  • New Member
  • *
  • Posts: 45
Borderless form doesn't minimize on ubuntu.
« on: February 10, 2014, 05:41:26 pm »
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

  • Hero Member
  • *****
  • Posts: 1596
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Borderless form doesn't minimize on ubuntu.
« Reply #1 on: February 10, 2014, 08:00:54 pm »
I'm not sure that it's possible to "minimize" frameless form under X11.You can hide it.

georgebou

  • New Member
  • *
  • Posts: 45
Re: Borderless form doesn't minimize on ubuntu.
« Reply #2 on: February 12, 2014, 10:02:40 pm »
I'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

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Borderless form doesn't minimize on ubuntu.
« Reply #3 on: February 13, 2014, 03:39:46 pm »
Quote
b. 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

  • New Member
  • *
  • Posts: 45
Re: Borderless form doesn't minimize on ubuntu.
« Reply #4 on: February 13, 2014, 04:29:24 pm »
Quote
b. 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

  • Guest
Re: Borderless form doesn't minimize on ubuntu.
« Reply #5 on: February 13, 2014, 04:47:41 pm »
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

  • New Member
  • *
  • Posts: 45
Re: Borderless form doesn't minimize on ubuntu.
« Reply #6 on: February 13, 2014, 06:39:04 pm »
I 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

  • New Member
  • *
  • Posts: 45
Re: Borderless form doesn't minimize on ubuntu.
« Reply #7 on: February 22, 2014, 02:46:47 pm »
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

  • Guest
Re: Borderless form doesn't minimize on ubuntu.
« Reply #8 on: February 22, 2014, 03:26:09 pm »
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

  • New Member
  • *
  • Posts: 45
Re: Borderless form doesn't minimize on ubuntu.
« Reply #9 on: February 22, 2014, 09:23:54 pm »
Yea it's not a crash.

You just can't see the form on the taskbar so that you restore it.

zeljko

  • Hero Member
  • *****
  • Posts: 1596
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Borderless form doesn't minimize on ubuntu.
« Reply #10 on: February 22, 2014, 11:13:19 pm »
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

  • New Member
  • *
  • Posts: 45
Re: Borderless form doesn't minimize on ubuntu.
« Reply #11 on: February 23, 2014, 01:18:26 am »
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.

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

  • Guest
Re: Borderless form doesn't minimize on ubuntu.
« Reply #12 on: February 23, 2014, 02:30:28 am »
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

  • New Member
  • *
  • Posts: 45
Re: Borderless form doesn't minimize on ubuntu.
« Reply #13 on: February 23, 2014, 12:20:56 pm »
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.

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

  • Hero Member
  • *****
  • Posts: 1596
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Borderless form doesn't minimize on ubuntu.
« Reply #14 on: February 23, 2014, 05:59:04 pm »
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.

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 ?


 

TinyPortal © 2005-2018