MCPcopy Index your code
hub / github.com/material-shell/material-shell / constructor

Method constructor

src/manager/msResizeManager.ts:48–120  ·  view source on GitHub ↗
(msWindowManager: MsWindowManager)

Source from the content-addressed store, hash-verified

46 throttledCheckPointerPosition: () => void;
47
48 constructor(msWindowManager: MsWindowManager) {
49 super();
50
51 this.msWindowManager = msWindowManager;
52 this.resizeInProgress = null;
53 this.inputResizer = new InputResizer();
54
55 this.observe(
56 global.display,
57 'grab-op-begin',
58 (_, metaWindow, directionOp: Meta.GrabOp) => {
59 Debug.logFocus(
60 'START DRAG',
61 directionOp,
62 RESIZE_CODES.includes(directionOp)
63 );
64 if (RESIZE_CODES.includes(directionOp)) {
65 const msWindow = metaWindow.msWindow;
66
67 if (
68 msWindow &&
69 msWindow.metaWindow === metaWindow &&
70 !msWindow.followMetaWindow
71 ) {
72 //global.display.end_grab_op(global.get_current_time());
73
74 const { layout } = msWindow.msWorkspace;
75
76 if (!(layout instanceof BaseResizeableTilingLayout)) {
77 return;
78 }
79
80 const vertical =
81 RESIZE_VERTICAL_CODES.includes(directionOp);
82 const after = RESIZE_AFTER_CODES.includes(directionOp);
83 const border = layout.getTileableBorder(
84 msWindow,
85 vertical,
86 after
87 );
88
89 if (border) {
90 this.startResize(border);
91 }
92 }
93 }
94 }
95 );
96
97 this.observe(
98 this.inputResizer,
99 'captured-event',
100 (_, event: Clutter.Event) => {
101 if (this.resizeInProgress !== null) {
102 switch (event.type()) {
103 case Clutter.EventType.MOTION:
104 this.checkPointerPosition();
105 break;

Callers

nothing calls this directly

Calls 8

startResizeMethod · 0.95
checkPointerPositionMethod · 0.95
endPointerCheckerMethod · 0.95
throttleFunction · 0.90
logFocusMethod · 0.80
getTileableBorderMethod · 0.80
typeMethod · 0.80
observeMethod · 0.45

Tested by

no test coverage detected