mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Use shell-global to check if mouse btn is pressed
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
const Lang = imports.lang;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
|
||||
@@ -295,12 +296,14 @@ var Intellihide = Utils.defineClass({
|
||||
}
|
||||
|
||||
if (fromRevealMechanism) {
|
||||
let mouseBtnIsPressed = global.get_pointer()[2] & Clutter.ModifierType.BUTTON1_MASK;
|
||||
|
||||
//the user is trying to reveal the panel
|
||||
if (this._monitor.inFullscreen && !this._panelManager.mouseBtnPressed) {
|
||||
if (this._monitor.inFullscreen && !mouseBtnIsPressed) {
|
||||
return this._dtpSettings.get_boolean('intellihide-show-in-fullscreen');
|
||||
}
|
||||
|
||||
return !this._panelManager.mouseBtnPressed;
|
||||
return !mouseBtnIsPressed;
|
||||
}
|
||||
|
||||
if (!this._dtpSettings.get_boolean('intellihide-hide-from-windows')) {
|
||||
|
||||
@@ -36,7 +36,6 @@ const Utils = Me.imports.utils;
|
||||
|
||||
const Lang = imports.lang;
|
||||
const Gi = imports._gi;
|
||||
const Atspi = imports.gi.Atspi;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
@@ -50,16 +49,12 @@ const PanelMenu = imports.ui.panelMenu;
|
||||
const Layout = imports.ui.layout;
|
||||
const WorkspacesView = imports.ui.workspacesView;
|
||||
|
||||
const ATSPI_MOUSE = 'mouse:button:';
|
||||
const ATSPI_MOUSE_EVENTS = ['1p', '1r'];
|
||||
|
||||
var dtpPanelManager = Utils.defineClass({
|
||||
Name: 'DashToPanel.PanelManager',
|
||||
|
||||
_init: function(settings) {
|
||||
this._dtpSettings = settings;
|
||||
this.overview = new Overview.dtpOverview(settings);
|
||||
this.mouseBtnPressed = false;
|
||||
},
|
||||
|
||||
enable: function(reset) {
|
||||
@@ -147,9 +142,6 @@ var dtpPanelManager = Utils.defineClass({
|
||||
|
||||
this._needsDashItemContainerAllocate = !Dash.DashItemContainer.prototype.hasOwnProperty('vfunc_allocate');
|
||||
|
||||
this._mouseListener = Atspi.EventListener.new(e => this.mouseBtnPressed = e.type.slice(-1) == 'p');
|
||||
ATSPI_MOUSE_EVENTS.forEach(e => this._mouseListener.register(ATSPI_MOUSE + e));
|
||||
|
||||
if (this._needsDashItemContainerAllocate) {
|
||||
Utils.hookVfunc(Dash.DashItemContainer.prototype, 'allocate', this._newDashItemContainerAllocate);
|
||||
}
|
||||
@@ -250,8 +242,6 @@ var dtpPanelManager = Utils.defineClass({
|
||||
if (this._needsDashItemContainerAllocate) {
|
||||
Utils.hookVfunc(Dash.DashItemContainer.prototype, 'allocate', function(box, flags) { this.vfunc_allocate(box, flags); });
|
||||
}
|
||||
|
||||
ATSPI_MOUSE_EVENTS.forEach(e => this._mouseListener.deregister(ATSPI_MOUSE + e));
|
||||
},
|
||||
|
||||
setFocusedMonitor: function(monitor, ignoreRelayout) {
|
||||
|
||||
Reference in New Issue
Block a user