Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

make full-screen! work on mac #85

Closed
wants to merge 1 commit into from

2 participants

@arthuredelstein

Hi Dave,

I found I needed to add this code to make seesaw.core/full-screen! work properly on the mac. I believe this should also work fine on Windows.

Arthur

@daveray
Owner

hmmm. So was the problem that if the window isn't already undecorated, full-screen! fails? The reason I ask is that I only ever tested full screen on Mac, so it at least works for me. I'm a little hesitant to assume that full screen automatically strips decorations or puts them back. For example, if you wanted your window to always be undecorated, this change would break that I think. Maybe we need functions for decorating/undecorating windows and then make the docs for full screen clear that it only works with undecorated windows? Thoughts?

@arthuredelstein
@arthuredelstein
@daveray
Owner

Yeah, that's an option. We could use seesaw.meta to remember the desired decoration state across calls. That seems like a reasonable compromise.

@daveray
Owner

I created a more general fix based off your pull request. It's in 15e33bb. Give it a try and let me know if it helps.

@daveray daveray closed this
@arthuredelstein

It works great! Thanks, Dave!

Arthur

@daveray
Owner

Cool! I'm always surprised when things work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 2, 2012
  1. @arthuredelstein
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/seesaw/core.clj
View
13 src/seesaw/core.clj
@@ -2673,7 +2673,18 @@
"Make the given window/frame full-screen. Pass nil to return all windows
to normal size."
([^java.awt.GraphicsDevice device window]
- (.setFullScreenWindow device (to-root window))
+ (if window
+ (let [root (to-root window)]
+ (when (not= (.getFullScreenWindow device) root)
+ (.dispose root)
+ (.setUndecorated root true)
+ (.setFullScreenWindow device root)
+ (.show root)))
+ (when-let [root (.getFullScreenWindow device)]
+ (.dispose root)
+ (.setFullScreenWindow device nil)
+ (.setUndecorated root false)
+ (.show root)))
window)
([window]
(full-screen! (default-screen-device) window)))
Something went wrong with that request. Please try again.