I have an application window that I do not want to be able to be resized (always maximized). On creating the window I set it to maximized, however if the window is minimized and then restored, it restores to the default size (width, height).
So my question is how do I ensure that the window is restored to a maximize state? Is there a window state changed signal (or something similar) that I need to handle?
An update, I was able to achieve the outcome with the following in my application activate signal callback (the window is created in startup to prevent multiple windows from being able to be opened):
Yes, I currently have two monitors. When I move windows between different monitors, it causes the window position to shift randomly. It’s very chaotic.
Perhaps it is possible to listen to motion events, determine the position of the pointer in a timely manner, and obtain the monitor where the mouse pointer is located. Then transfer the window. I haven’t tried yet. I am not very familiar with the operation of multiple monitors.
Another issue is to maintain maximization.
I am unable to obtain the status of the window by listening to Window:maximized.
You can continue your research. You can take a look at GdkToplevel
The possible issue is that setting maximum is not a timely operation and may result in delays.
This is for a very specific application that is only going to run on a laptop (so single monitor and only one size). I just thought if I was going to try and achieve this behaviour, it may be worth figuring out how to do it for the general case (if the need ever arises again, I doubt it will though).
I was thinking about using the on focus signal to determine when the window was being restored (after being minimized), then calling maximize again.
Thank you for your feedback, having no experience/knowledge with GTK this is very much a learning journey for me.