shoes4
shoes4 copied to clipboard
Shoes - window always on top
Came in through the mailing list:
what about setting the 'always on top' state of a shoes window?
what is meant here is probably that the window is always on top and can not be sent to the background. This seems to be rather simple in SWT (just a style for the shell): swt thread
This might be not so easy to implement for Linux. There is this bug which makes styles other than SWT.ON_TOP
to disappear. I tested it on Ubuntu 14.04 and the app window looks like a square, i.e no close, minimize, maximize buttons, etc.
Not sure about other platforms.
That seems totally weird, that bug is so old (also the duplicated one) that it seems so weird that it isn't fixed in an up to date SWT we use... :/
Since it's an upstream bug I believe all we can do is use it and reference that bug that needs fixing.
I would love support for this for a project I'm working on! edit: I'm also happy to try adding it myself if you could give me a little direction edit: Actually, I got it working! Just need to fix up the tests
:D
@AStrangeEnigma that sounds great! My general guidance would be this (and I should probably also write that up some time...): The data if something should be "always on top" should be held in the DSL class Shoes::App
, the actual implementation of being always on top that is backend specific goes into Shoes::Swt::App
. And I'd like the option to be passed on startup so that I can do
Shoes.app always_on_top: true do
# ...
end
Feel free to open a pull request even with broken tests. We can help you fix them up :)
Great!
What I ended up doing was just adding the one line
style |= ::Swt::SWT::ON_TOP if @dsl.opts[:always_on_top]
in main_window_style
To get exactly the behavior you mentioned. Is there somewhere else I should change?
that seems perfectly valid :) Would you care make a PR? Otherwise we'll have to wait until Jason or I get to it :) And you'd miss out on all the glory! :)
I'll make the PR tonight!
#1172