An Electron & Vue.js quick start boilerplate with vue-cli scaffolding, common Vue plugins, electron-packager/electron-builder, unit/e2e testing, vue-devtools, and webpack.
I thought I'd post a solution to this problem since it took me a while to figure out, but adds so much utility.
The idea here is that you can create transparent windows that are click-through, so where you have an element that element can be clicked on, but say it's just empty window space, the user can click on what's under the window successfully.
This enables powerful overlays to be built on this framework. Here's how to do it.
In your main/index.js
when creating browser window, add:
frame: false,
transparent: true
In your Component.vue
created () {
var t
var setIgnoreMouseEvents = this.$electron.remote.getCurrentWindow().setIgnoreMouseEvents
window.addEventListener('mousemove', event => {
if (event.target === document.documentElement) {
setIgnoreMouseEvents(true, {forward: true})
if (t) clearTimeout(t)
t = setTimeout(function () {
setIgnoreMouseEvents(false)
}, 150)
} else setIgnoreMouseEvents(false)
})
},
I thought I'd post a solution to this problem since it took me a while to figure out, but adds so much utility. The idea here is that you can create transparent windows that are click-through, so where you have an element that element can be clicked on, but say it's just empty window space, the user can click on what's under the window successfully.
This enables powerful overlays to be built on this framework. Here's how to do it.
In your main/index.js
when creating browser window, add:
In your Component.vue
and
and there you have it! Your elements are clickable but the empty space is click-through!