question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prevent maximizing on double-click using `-webkit-app-region:drag

See original GitHub issue

Hi,

I have the opposite issue of #2210. I’m using the -webkit-app-region:drag css style on my body.

I would like to use drag-drop functionality for my nw-windows, without giving the possibility to maximize them by doubleclicking, because those windows aren’t supposed to be maximized at all.

I have tried to overwrite the onclick event on the whole body of my window:

document.onclick=function(e){
  e.preventDefault();
}

but this doesnt have any impact.

Is they anyway to have the drag-drop behaviour without also having the doubleclicking behaviour ?

<bountysource-plugin>

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
wufeng87commented, Nov 6, 2015

Using this method (thx my friend), work much better.

    var wX = 0;
    var wY = 0;
    var dragging = false;
    $nav.mousedown(function(e){
        dragging = true;
        wX = e.pageX;
        wY = e.pageY;
    });
    $(window).mousemove(function(e){
        if(dragging){
            win.moveTo(e.screenX-wX, e.screenY-wY);
        }
    });
    $(window).mouseup(function(){
        dragging = false;
    });
0reactions
edi9999commented, Jul 28, 2017

We can close this

Read more comments on GitHub >

github_iconTop Results From Across the Web

Double click the element with style "-webkit-app-region: drag;"
Double click the element with style "-webkit-app-region: drag;" to maximize the window leads to an error that "maximize" button does not change.
Read more >
Prevent maximizing on double-click using `-webkit-app-region:drag
Prevent maximizing on double-click using `-webkit-app-region:drag ... Hi,. I have the opposite issue of #2210. I'm using the -webkit-app-region:drag css style on ...
Read more >
Window Customization | Electron
By default, the frameless window is non-draggable. Apps need to specify -webkit-app-region: drag in CSS to tell Electron which regions are draggable (like...
Read more >
Frameless Window in ElectronJS - GeeksforGeeks
Applications need to specify the -webkit-app-region: drag CSS property to tell Electron which regions are draggable. To make the whole window ...
Read more >
Safari Technology Preview Release Notes - Apple Developer
Send notifications to people who opt-in on your website or web app with Safari ... to get a snapshot as when using only...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found