Lou Hamers wrote:Yeah... this is unfortunate. I've seen similar problems and I'm not sure there's really a solution to make this work well in all cases. It may be related to the version of Java/JavaFX also (I don't remember issues with doing this on 8).
I did have a "frameless" project, but I can't remember what the issues were. I'll have to go take a look at it, but I'm not optimistic that I found a perfect solution to this problem. I also saw similar problems with some of the frameless implementations that others have published.
I recommend sticking to a decorated stage if you have the option. I'll post here if I find anything that might work better.
Lou Hamers wrote:Oh, because of the need to have tabs on the very top pixel of the screen? Yeah that is important.
Using FX alongside Swing has been done before and is probably fine, especially if you limit it to just the "frame". But I don't have a ton of experience with that configuration so I can't say too much on it. Whether you "should" try that is probably going to depend on who you ask. If it works, you do what you have to do to get it done! Do be aware that Swing and JFX run on entirely different background threads, the "EDT" (Event Dispatch Thread) and the "JavaFx Application Thread", so that's where you might hit a complication. But it might be perfectly fine too...
I've definitely seen Undecorator and the other sounds familiar. Undecorator worked fine on Java 8, so maybe it's a newer JDK issue.
I found one of my projects experimenting with this stuff, with this note at the top from when I took a break to work on something else:
I think it worked OK, but not as well as I'd have liked. Unfortunately I also left it in a non-working state.
I remember seeing two performance issues. One was an initial white background (the scene "fill" background color) that briefly flashed sometimes. I mitigated that by just setting the fill color to a background similar enough to the theme color:
The other more annoying problem was component size "flickering", as containers tried to resize and catch up with the stage resizing. The multi-monitor issue IIRC was relating to resizing the edge of the window into another monitor/display, but I believe that was a solvable problem.
Not total show stoppers maybe but annoying enough that I wasn't happy with it. I definitely wasn't at a "giving up" point though. We might be able to find ways to mitigate or solve these glitches (perhaps just find a good way to throttle or slightly time-delay the stage size changes), I just found a different project I wanted to focus on more and put this on hold.
Are those the performance issues you're seeing, or are you seeing something else? Your code is doing pretty much what mine does and I don't think you're doing anything "wrong".
Lou Hamers wrote:Yeah the left and right "resizes" are really a window move AND a resize.
It looks like your code link is incomplete, BTW.
One strategy you could try, if you can accept any downsides, would be to see if you can remove most or all of the scene temporarily during the resize drags (it could be replaced with a nice "resizing" placeholder graphic), and then re-add it all back when done. There is some cost to doing that, but if it's just at the start/end it might be okay.
You will need to make sure you maintain good view/model separation if you do that, of course. But I always recommend keeping that in focus anyway.
Kevin Ferreira wrote:
what you mean removing the scene temporarily will result into? the effect itself that code into the left resizing is moving the borders while dragging, that looks so bad, don't know if it is an 'animation' issue only, you know? i am basicly open for ANYTHING that would result in a similar effect as the inbuilt DECORATED resizing system
Lou Hamers wrote:What operating system are you on, by the way? And GPU type?
For the window flickering issue, it's possible there may just be no fix without filing a good bug report. But it would need to be a very good one which is reproducible, because I've seen some past reports for this issue that have been dismissed for one reason or another.
Kevin Ferreira wrote:
Gotta realize that it's not only about it flickering but the resizing itself moves the border and trembles, thats why i think it has to do with JavaFX inbuilt functionality not any graphics GPU issue.
Hot dog! An advertiser loves us THIS much:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|