Skip to content

New title-bar-style feature breaks -webkit-app-region: drag #2862

Closed

Description

@ialexryan

Was very excited to switch from frame: false to title-bar-style: hidden but dismayed to discover that all the areas I marked -webkit-app-region: drag with CSS were no longer draggable. What's going on there?

Using Electron 0.33.0 on OS X 10.10.4.

Activity

  1. jaanus commented on Sep 22, 2015

    @jaanus
    Contributor

    I tested this. This doesn’t seem to be about the new title-bar-style breaking anything; rather, -webkit-app-region: drag only seems to work for me with frame: false. This does feel like a bug, since the documentation doesn’t limit the dragging working only to frameless windows.

    I can definitely see how the drag behaviour would be useful with the new title bar styles as well. Not sure why it’s currently only working with a frameless window, need to dig around a bit more for this.

  2. jaanus commented on Sep 22, 2015

    @jaanus
    Contributor

    Okay. This comes from Chromium. Apparently, it’s implemented there such that the dragging property only has an effect when frame: false is set. But currently, when you set frame: false, you can’t get any of the new title bar look/behavior. The two API-s are a bit at odds with each other.

    I can think of several ways to solve this, would be interested in feedback before jumping on any of them.

    • Patch Chromium so that -webkit-app-region: drag works regardless of the window configuration. (Sometimes it would be useful to have draggable elements in framed windows as well?)
    • Modify the Electron window setup behavior such that if title-bar-style: hidden, this to Chromium also means that frame:false, yet the title bar (which is invisible, doesn’t take up window content space, but still shows traffic lights) is still drawn on the Electron side.
  3. tommoor commented on Sep 24, 2015

    @tommoor
    Contributor

    There is another issue that was introduced at the same time that is proving to be really frustrating. Even with frame: false draggable regions are only draggable as long as the cursor stays inside them, so if you click and drag a window then it stops dragging when the cursor moves outside the bounds.

    This essentially makes the feature useless in the last several releases.

  4. tommoor commented on Sep 24, 2015

    @tommoor
    Contributor

    Video here: https://cloudup.com/ckixaDrf6NB - note I was holding the mouse at all times during this demo and this app does not use the new title-bar-style functionality - those window controls are css.

  5. self-assigned this
    on Sep 25, 2015
  6. pronebird commented on Nov 17, 2016

    @pronebird

    I can't drag when dev tools are displayed. Is it expected?

  7. tommoor commented on Nov 17, 2016

    @tommoor
    Contributor

    @pronebird it's a known issue, #3647

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions