-
-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Window Transparency Setting Messes with Window Size, Style, and Randomly Remains Opaque #1046
Comments
@D-Maxwell While I appreciate the issue, this is very much known. We tried to get this across in the setting description of We are aware that just enabling this doesn't really look that great. There were attempts to make this feature usable on our default provided themes, but doing so was much much easier said than done. Leaving us to essentially offer the ability for "community UI themes and user stylesheets" to utilize this feature. We know you wanted this feature, so we wanted to make sure we could support you and the rest of the community in having it, even if we don't have the time ourselves to make a stylesheet that makes it perfect. Considering the time you spent working on your user stylesheet to make this work, I'd highly recommend that you could publish those changes as a community UI theme for everyone else, or even if you don't want to, we could look at using But otherwise I apologize if this was an underwhelming change, but our goal in the PR that was merged was to make this behavior possible rather than take advantage of it completely. While that may or may not change in the future, I'd love to see someone from the community be able to turn it into something truly great, now that it is possible at all. (I'd like to note I don't speak for DeeDeeG who authored the changes themselves, but was communicating with them through the difficulties in attempting to utilize these features in built in themes, and may have supported the current course of action in simply making the feature possible.) |
I'll admit I was surprised to see the difference between the implied dimensions of the window (as indicated by the title bar and placement of the close/minimize/maximize buttons) and the dimensions that we actually occupy. Was that a known issue? |
@confused-Techie seems to have focused on exactly the one thing... that I had been expecting. I would certainly prefer for you to focus on the other issues this seems to have brought --and that I have reported above--, as I reckon you must have misunderstood me by expecting my own expectations to be such that Pulsar would automatically "look good" with this option on. |
I had indeed thought of releasing my humble --somewhat messy and hastily put together-- stylesheet, although I have never done that in the past. I may consider getting to it once I am done covering all use cases (as for some reason some panels are unaffected by the global rules I have defined, such as the Settings pane), and once I finish tidying it up. |
I haven't found any related ones prior to opening this issue. Would you be aware of any clues as to where exactly the root cause may lie ? |
No; I have no experience with this area of Electron. This is not very high on my list of concerns right now, but that's just because I've got six other Pulsar-related tasks going at any one time. Another team member may be able to run some quick experiments to figure out what's going on, but if not, this might just be a symptom of the fact that we're on an old version of Electron. @mauricioszabo runs a version of Pulsar updated to the latest Electron; he might be able to check this for you if he's in a good mood. @D-Maxwell, would it be possible for you to isolate some small amount of CSS that would set a transparent background on most themes? If not, it's OK; it'd just be nice to have something that a user could paste into their stylesheet to test transparency instead of having to create a whole theme. |
Sure, I was already planning on doing something akin to this. Looking forward to those issues being fixed, but take your time, this is no matter rendering the program unusable. |
I mean something more like the least amount of CSS/Less that a user can apply to turn their current theme transparent. Ideally this would be something small enough to paste into this issue or into a Gist. If it helps, try the following more specific exercise:
|
Literal values were decided arbitrarily, but not including them would yield an absolutely illegible workspace. // Translucence //
/// Absolutely Necessary ///
atom-text-editor {
background-color: rgba(0,0,0, calc(2/3));
// bodge, bad dobby bad
& *:not(:is(atom-overlay, .selection.region)) {
// why should every sub-component have its own background declared independently...
background: none !important;
}
}
html, atom-workspace {
background: transparent;
}
.atom-dock-mask {
background-color: transparent;
& * {
background: none;
}
}
/// Recommended ///
.atom-dock-mask .item-views {
background: rgba(0,0,0, calc(3/5)); // 2/3 as well ?
}
.atom-dock-mask * {
color: white;
}
.pane > ul[is="atom-tabs"] {
background: none;
& > li[is="tabs-tab"] {
--_opacity: calc(1/2);
background-color: rgba(0,0,0, var(--_opacity)) !important;
&.active {
--_opacity: calc(2/3);
}
}
}
/// Eye Candy ///
atom-panel-container.footer > atom-panel.panel-footer {
background-color: rgba(0,0,0, calc(1/2));
& > * { background: none; }
}
// text selection highlight
atom-text-editor .selection.region {
// not sure what the default opacity should be, this may turn out overly soft for most, despite being subtile enough to my eyes
background-color: rgba(0,0,0,0.25);
}
// entry selection highlight
.tool-panel.tree-view ol.list-tree > li::before {
opacity: 0.5; // quick fix, to reconsider
}
.pane > ul[is="atom-tabs"] {
// for some reason box-shadow is used as a border ???
box-shadow: none;
& > li[is="tabs-tab"] {
// this could mayhaps be turned into a slight gap
border: none; // border is overdrawn by accent, only visible past three open tabs
}
}
.atom-dock-inner, atom-pane.pane {
border: none !important;
}
.tab-bar .tab:last-of-type {
// return of the box shadow border
box-shadow: none;
}
// AutoComplete Modal [WIP] //
atom-overlay[class*="autocomplete"] {
position: absolute !important;
}
atom-overlay[class*="autocomplete"] > autocomplete-suggestion-list {
backdrop-filter: blur(40px);
background-color: rgba(0,0,0,0.25) !important;
} |
@D-Maxwell, I'm reading the Electron docs and I'm wondering what would happen if you tried this:
We didn't read the docs closely enough; window transparency on Windows only works when the I don't know what this will end up looking like, but I think there's a good chance you won't have minimize/maximize/close controls. If it improves the situation, we'll see about making that setting automatic on Windows when transparency is on. I'm sorry that we didn't do this right the first time around. |
Oof; the caveats are pretty severe:
That's probably going to be harder to work around than the lack of window chrome. |
OK, I poked around to see if I could find a root cause. It's mostly above my head, but this PR explains it a bit: Frameless windows are opting out of some of the baseline assumptions that Windows makes about… windows. For instance, if a window doesn't have a frame, Windows doesn't really have a concept of what it means for that window to be “maximized” — perhaps since one of the assumptions of framelessness is that it enables you to do oddball stuff like have a window of a custom shape. The Electron folks had adopted some workarounds for this constraint in the past, but they broke over time, so eventually they just documented the constraint and left it at that. I don't know if this means that the window truly can't be resizable… or just can't be automatically resizable. It wouldn't surprise me if BrowserWindow#setBounds still worked as expected, but neither would it surprise me if it didn't. Maybe opting into framelessness just causes Windows to say “fine, you're in charge of managing your own dimensions.” The best-case scenario here is that all of this stuff would still be doable… but would just have to be done by Pulsar manually rather than automatically by the OS. In the case of drag-resizing, for instance, that'd probably mean that we'd have to catch click events right on the corner of the window and write a handler that relayed information back to the main process about how to change the size of the window. That's not good news for you, I'm afraid. I'm pretty sure we'd accept a thoughtful PR that did the necessary work here — but even if you were willing to do that work, I'd suggest that you wait until we upgrade Pulsar to the latest Electron version, since I'd hate for you to come up with a solution and then run the risk of having it break when we update. Again, I'm sorry we didn't do more research beforehand; we could've set expectations better. |
@D-Maxwell, I'm curious what happens if you use the Atom API to set window dimensions explicitly. Open your developer tools with Ctrl+Shift+I (that'll screw up your window transparency, but hopefully only while the dev tools are open), then go to the Console tab and type something like atom.setSize(2500, 1300) and see what happens. I'm guessing it'll keep the same annoying “buffer” zone at the bottom and right edges of the window, but maybe you'll get lucky and they'll go away. |
@savetheclocktower, your comment regarding devtools and window transparency confused me, and legitimately so ; my Pulsar instance does not fail to render transparently even whilst debugging. (actually, it would seem that it may randomly fail once the devtools are closed, requiring a restart past calling Additionally, hard-setting the workspace dimensions through atom#setSize does indeed make the buffer zone vanish ! This is not an unstable state either, as the window may then be resized to any dimensions from its handles ! This is great, thank you so much ^°^ Hopefully this should be easy to trace and fix, or perhaps a quick bodge could be summarised as calling this method past whatever calls are responsible for the creation of the odd buffer zone. I may add that with the title-bar hidden, maximising the window --through AltSnap-- now works properly, as there is no title-bar component to revert the styling of back to that of Windows95. |
I'm as surprised as anyone that this has a happy-ish ending. As for the window opening at a very tiny size: you should be able to handle all this at once with something like this in your let { width, height } = atom.getSize();
if (width < 200 || height < 200) {
atom.setSize(800, 600); // Or whatever size you want
} else {
atom.setSize(width, height);
} |
That was my experience on macOS — that transparency went away when I opened dev tools and didn't come back after I closed them. It's also mentioned as one of the many caveats of window transparency. |
Hey ! Transparency doesn't work currently on Debian 12 with Gnome (even a special stylesheet)... apparently you can make it work by...adding a delay to the window see this stackoverlow question |
Thanks in advance for your bug report!
What happened?
After noticing that #948 had been considered for implementation, I couldn't help but upgrade to the latest release and enjoy an acrylic or even a plain blurred background for this great IDE ; to my surprise, I was met with quite a few annoyances, some of which looked terrible, and others outright preventing any use of the IDE as it remained in a collapsed state, unable to be focused, along an empty and tiny preview window from the taskbar entry. (this may or may not happen after disabling Window Transparency, postponing the restart, and enabling it once more, before then restarting, although I am now unable to reproduce this last issue)
Pulsar version
1.118.0
Which OS does this happen on?
🪟 Windows
OS details
Windows 10 Pro 22H2 19045.2788
Which CPU architecture are you running this on?
x86_64/AMD64
What steps are needed to reproduce this?
As seen in this first picture, the document's size does not match that of the window. I have also found it impossible to resize the window by its edges, although it does work through AltSnap (a Window Management Script). In such a scenario, the maximise button has no effect either.
Maximising the window through AltSnap --given the inefficiency of the intended button-- will either yield a black background in place of a transparent view --a screenshot for which I lack--, or will result in the title bar reverting to some XP-esque aesthetic.
As previously mentioned, at times, the window will spawn without respect to its last set size, and will default to the minimum window size ; which, in conjunction to the document not filling the whole window for some reason, leads to a purely empty window, unless manually expanded ; once again, through the use of a script, as the edges refuse to be considered as such upon hovering.
Additional Information:
I am quite disappointed seeing this feature that I for one had greatly anticipated, and I would love for it to become usable.
The text was updated successfully, but these errors were encountered: