linuxmint / muffin

The window management library for the Cinnamon desktop (libmuffin) and its sample WM binary (muffin)
GNU General Public License v2.0
196 stars 93 forks source link

How to switch from window state Iconic to Normal? #325

Open mse2 opened 6 years ago

mse2 commented 6 years ago

ICCCM states

Iconic -> Normal - The client should map the window.

https://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html#changing_window_state
Because muffin does not unmap minimized windows that does not work, please see https://github.com/linuxmint/Cinnamon/issues/7636
What is the official way to switch programmatically from Iconic to Normal on muffin?

JosephMcc commented 6 years ago

Sorry guys. I know you think I'm being rude but this isn't really an issue we are going to change. If you are looking for help, the best place would probably actually be #linuxmint-dev on spotchat irc.

I'm closing this since changing this behaviour has already been discussed and this isn't really a discussion forum. Being closed doesn't mean you can't still post in the issue.

Edit: This is also the 4th issue now opened about this same thing. Please stop opening new ones. There is nothing stopping you from posting in one of the other already closed ones.

mse2 commented 6 years ago

What does this mean? Muffin does not support to switch from Iconic state to Normal programmatically and the muffin team does not want to change this? Are you joking?
Or muffin supports it but the muffin team does not want to let the information how to do it to become public?
I feel really strange here.
BTW I asked this question on the forum almost a year ago but got no answer. https://forums.linuxmint.com/viewtopic.php?f=208&t=251032

brownsr commented 6 years ago

I don't think it was clear that you were just trying to work out how to get the Cinnamon window manager to respond. It appeared as if you were trying to report a standards issue, which would have broken key parts of the desktop if changed. JosephM is spot on when redirecting you to the irc channel, as you may find someone who can help on development issues from time to time available there.

One of the challenges of answering your question is that the js user interface interacts with the back end libraries via gobject introspection which makes things challenging to follow, and I don't know how the equivalent would work from pascal. But as an example if you look at the window-list applet (Cinnamon repository file/user/share/cinnamon/applets/window-list@cinnamon.org/applet.js) there's a function toggleWindow that toggles between icon and window open state. That in turn uses code in (Cinnamon repo) js/ui/main.js activateWindow and so on. As far as I can tell from a quick look it ends up calling window_activate in Muffin (/src/core/window.c). I am afraid documentation we have is only partial, and in practice I for one usually end up working backwards through the code to work out this sort of question. I am most definitely not knowledgeable in window manager protocols to be able to answer your question in perhaps a way that might be more what you are looking for.

The team is focussed on fixing issues reported in the beta at the moment, so won't have much time to spend on other types of things right now. If you don't get an answer that helps on linuxmint-dev after a while, you might like to check back after the release of mint 19 when people may have more time available.

Regards

Simon

mse2 commented 6 years ago

@JosephMcc

I'm closing this since changing this behaviour has already been discussed and this isn't really a discussion forum.

Please reopen the issue, this is about how to switch from Iconic to Normal state,
https://github.com/linuxmint/Cinnamon/issues/7636
is about missing unmap event which is something different.

@brownsr Thank you very much for your answer.
Do I read it correct, that it is not possible to switch from Iconic to Normal via ICCCM or EWMH, one should link to the muffin library in order to call window_activate()? The window should not be activated but mapped only.
Another problem is that MSEgui should not depend on installed libraries other than libc and xlib.
Maybe Qt and Gtk can link Mint libraries without problems, but Qt and Gtk are tested from Mint staff with the Mint libraries for every release and Qt and Gtk with the right versions are also distributed by Mint.
MSEgui runtime is normally statically linked into the MSEgui applications in order to guarantee easy distribution and installation on any system as a single binary.

Please allow a personal comment:
I work in the opensource community since 20 years and invested more than 20'000 hours into the development of MSEide+MSEgui and experienced a lot in this time but how one is treated in the Mint community is one of the worst experiences ever. If I had not learned that in order to work opensource one needs indefinite patience I had long gave up on Mint...

JosephMcc commented 6 years ago

Another problem is that MSEgui should not depend on installed libraries other than libc and xlib. Maybe Qt and Gtk can link Mint libraries without problems, but Qt and Gtk are tested from Mint staff with the Mint libraries for every release and Qt and Gtk with the right versions are also distributed by Mint.

Qt and Gtk are most definitely not linked against any Mint libraries. They just work. That's why I suggested that you look at the source for one of them and see how they manage this. We use Gtk for a lot of our stuff but have nothing to do with it's actual development.

mse2 commented 6 years ago

Please reopen the issue, maybe someone knows a solution.

mse2 commented 6 years ago

OK, it seems all muffin problems should be reported here. There are two problems with Z-order handling I found. Reports with test programs which demonstrate the wrong behavior are here https://github.com/linuxmint/muffin/issues/326 https://github.com/linuxmint/muffin/issues/327 I fear that some Mint people are not accustomed to read dense reports. ;-)

jujibo commented 6 years ago

Qt and Gtk are most definitely not linked against any Mint libraries. They just work. That's why I suggested that you look at the source for one of them and see how they manage this. We use Gtk for a lot of our stuff but have nothing to do with it's actual development.

Hello. I did a test to validate it.

A test program running under LinuxMint Cinnamon Linux Mint 18.3 Sylvia using Lazarus+Gtk2 I can change windows state programatically. From Normal to Maximized and Minimized is working fine. From Maximized to Minimized and Normal is working fine. From Minimized, trying to change windows state doesn't work.

All the above is working fine using Mate instead of Cinnamon.

This is using Gtk2, not MSE

mse2 commented 6 years ago

Can someone from Linux Mint staff comment on this please.
jujibo writes that Gtk can not switch from Iconic to Normal state on muffin. I was instructed to read the Gtk sources in order to find out, how on muffin the window state can be switched from Iconic to Normal. But if Gtk can't do it it makes no sense to study its code?

clefebvre commented 5 years ago

@jujibo can you paste your GTK code to illustrate this issue?

jujibo commented 5 years ago

Hi @clefebvre I have bad news. Martin Schreiber (@mse2) passed away on November 2018. He was the owner of MSEide+MSEgui. It was one man project. The future of MSEide+MSEgui is undetermined.

I have attached a project to check the issue. You need Lazarus for testing http://www.lazarus-ide.org/ TestMinimize.zip

The project has two forms. One form is to be maximized, minimized and restored to normal state. You can use buttons in Form1 to manage this.

As I said. The program run fine in Mate Desktop. In Cinnamon, everything work except changing from minimized to maximized or normal. The program is compiled using Lazarus+Gtk2