-
Notifications
You must be signed in to change notification settings - Fork 16.1k
With Developer Tools open, -webkit-app-region:drag
does not work
#3647
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
Comments
This is a side effect of #3163. |
This seems to be more of an issue now that the titleBarStyle behaviour was changed to not have the top area draggable by default |
Not sure if this was fixed but it works for me now (electron ...
win = new BrowserWindow({
frame: false
});
... ...
<head>
<style media="screen">
html, body {
-webkit-app-region: drag;
width: 100%;
height: 100%;
}
</style>
</head>
... |
It works for me on Windows too, but not sure if it was ever broken there. I can reproduce on Mac all the time. |
still an issue on os x 10.11.6 with Electron 1.6.2 using either |
Issue confirmed on macOS Sierra with Electron 1.6.4. This issue should be at least documented if not fully resolvable in the near term due to low priority. |
I can confirm this issue still on latest version of |
A workaround for those that are affected by this long standing bug - if you hover the mouse over the top edge of the window until you see a resize cursor and then hold and drag to the side instead of up and down to resize it will let you move the window. |
I made a PR to add a note about this to the documentation #9155 |
It not working on win10 , The native titlebar always displaying. |
An alternative workaround is using https://github.com/kapetan/electron-drag. edit: as of electron 4 this also no longer seems to work :( |
Needed so that the app can be moved in electron mode. There is an electron bug, however, that does not allow you to move the app when chrome DevTools is docked to the left, bottom, or right. electron/electron#3647 for more info, but for now, you can either open the inspector in a seperate windown, or close the inspector when you need to move the app
Mac move window not work after called setSize |
I have the same issue. Current window can be dragged to everywhere freely, but it doesn't work when i try to resize current window(remote.getCurrentWindow().setSize()) |
If someone needs a workaround you can, in JS, switch style of a drag element to no-drag and after a small timeout to drag again. If you do this to one element the window will reinit the dragging of every element and magically all will work again. |
@yaddran how exactly does that work? |
Well depending on the framework (or no framework) you use in the renderer process you need to change the element style from JavaScript (you can even use pure DOM and setTimeout). So, you set the style to no-drag, then do the setSize and then use setTimeout to schedule change of the element style back to drag (after 500 milli for instance). The window will resize and very soon after that the new drag will kick in and the browser will re-apply it to all elements that have drag, including the one that you are changing. |
@yaddran I see. I was hoping this trick would also just fix the issue where using the mouse will no longer move the window, but I tried it and it does not help for that case. |
@bpasero |
@yaddran can you possibly come up with a sample hello world electron app to show this? |
I tried @yaddran's suggestion for the initial issue with devtools open, but unfortunately it doesn't fix it for that case. |
Will #21704 fix this actually? |
@bpasero interested to find out! |
#21704 is in the release 7.1.9, so I tried it out and no luck. |
@Kilian confirmed in my projects as well |
Hi, here is a problem.
My div can't be Is there a way to make it work immediately? |
For me, this workaround actually works on any edge. For example, position your mouse cursor at the right edge until the resize pointer appears. Then, move your mouse cursor vertically instead of horizontally. You will then be able to move the window in any direction. |
Had this issue on electron v 14.0.1 and 15.0.0 beta releases but downgrading to v ^13.0.0 solved my issue |
I have the same problem with drag
|
Try downgrading to electron v 13.0.0 |
I got 13.3.0 version and drag is working ❤❤❤ |
…apabilities this address the electron v14 onward drag issue: electron/electron#3647
Why the option -webkit-app does not show to me when writing? |
This is a regression—in Electron
0.35.1
, draggable regions of the window stop working when the developer tools are opened. This means that the window effectively can't be moved while the developer tools are open. It doesn't matter if the developer tools are docked or in a separate window.I think this might be a side effect of an intentional change? In previous versions, you couldn't use the "Inspect Element" feature to click and select part of the DOM that was in a draggable region (since it was still draggable.) That now works (I can hover over and click on my title bar), but I can't move the window.
Here's a sample app to reproduce. Open the app, enable "top toolbar" and then open the developer tools:
https://dl.dropboxusercontent.com/u/4803975/frameless-window.zip
The text was updated successfully, but these errors were encountered: