@@ -4,6 +4,7 @@ import '@girs/gjs';
44import St from '@girs/st-17' ;
55import Clutter from '@girs/clutter-17' ;
66import GObject from '@girs/gobject-2.0' ;
7+ import GLib from '@girs/glib-2.0' ;
78import Meta from '@girs/meta-17' ;
89import Shell from '@girs/shell-17' ;
910
@@ -13,6 +14,7 @@ import type { DashBounds } from '../../ui/dash.ts';
1314
1415const HOT_AREA_TRIGGER_SPEED = 150 ;
1516const HOT_AREA_TRIGGER_TIMEOUT = 550 ;
17+ const HOT_AREA_DEBOUNCE_TIMEOUT = 250 ;
1618
1719/**
1820 * Invisible input barrier at the bottom screen edge.
@@ -29,6 +31,7 @@ export class DockHotArea extends St.Widget {
2931 private _horizontalBarrier : Meta . Barrier | null = null ;
3032 private _triggerAllowed = true ;
3133 private _monitor : DashBounds ;
34+ private _pointerDwellTimeoutId = 0 ;
3235
3336 _init ( monitor : DashBounds ) {
3437 super . _init ( { reactive : true , visible : true , name : 'aurora-dock-hot-area' } ) ;
@@ -45,7 +48,21 @@ export class DockHotArea extends St.Widget {
4548 } , this ) ;
4649
4750 this . connectObject ( 'enter-event' , ( ) => {
48- if ( this . _triggerAllowed ) this . emit ( 'triggered' ) ;
51+ if ( this . _triggerAllowed ) {
52+ this . _pointerDwellTimeoutId = GLib . timeout_add ( GLib . PRIORITY_DEFAULT , HOT_AREA_DEBOUNCE_TIMEOUT , ( ) => {
53+ this . emit ( 'triggered' ) ;
54+ this . _pointerDwellTimeoutId = 0 ;
55+ return GLib . SOURCE_REMOVE ;
56+ } ) ;
57+ }
58+ return Clutter . EVENT_PROPAGATE ;
59+ } , this ) ;
60+
61+ this . connectObject ( 'leave-event' , ( ) => {
62+ if ( this . _pointerDwellTimeoutId ) {
63+ GLib . source_remove ( this . _pointerDwellTimeoutId ) ;
64+ this . _pointerDwellTimeoutId = 0 ;
65+ }
4966 return Clutter . EVENT_PROPAGATE ;
5067 } , this ) ;
5168
@@ -70,6 +87,11 @@ export class DockHotArea extends St.Widget {
7087 global . display . disconnectObject ( this ) ;
7188 this . _destroyBarrier ( ) ;
7289
90+ if ( this . _pointerDwellTimeoutId ) {
91+ GLib . source_remove ( this . _pointerDwellTimeoutId ) ;
92+ this . _pointerDwellTimeoutId = 0 ;
93+ }
94+
7395 this . _pressureBarrier ?. disconnectObject ?.( this ) ;
7496 this . _pressureBarrier ?. destroy ?.( ) ;
7597 this . _pressureBarrier = null ;
0 commit comments