MCPcopy
hub / github.com/paperwm/PaperWM / createBackground

Method createBackground

tiling.js:1908–1984  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1906 }
1907
1908 createBackground() {
1909 const monitor = this.monitor;
1910 if (!monitor) {
1911 return;
1912 }
1913
1914 if (this.background) {
1915 this.signals.disconnect(this.background);
1916 this.background.destroy();
1917 }
1918
1919
1920 this.background = new Meta.BackgroundActor(
1921 Object.assign({
1922 name: "background",
1923 monitor: monitor.index,
1924 reactive: true, // Disable the background menu
1925 }, { meta_display: display })
1926 );
1927
1928 this.actor.insert_child_below(this.background, null);
1929
1930 this.signals.connect(this.background, 'button-press-event',
1931 (_actor, _event) => {
1932 if (inGrab) {
1933 return;
1934 }
1935
1936 /**
1937 * if user clicks on window, then ensureViewport on that window before exiting
1938 */
1939 let [gx, gy] = global.get_pointer();
1940 let [, x, y] = this.actor.transform_stage_point(gx, gy);
1941 let windowAtPoint = !Gestures.gliding && this.getWindowAtPoint(x, y);
1942 if (windowAtPoint) {
1943 ensureViewport(windowAtPoint, this);
1944 }
1945
1946 spaces.selectedSpace = this;
1947 Navigator.finishNavigation();
1948 });
1949
1950 // ensure this space is active if touched
1951 this.signals.connect(this.background, 'touch-event',
1952 (_actor, _event) => {
1953 this.activateWithFocus(this.selectedWindow, false, false);
1954 });
1955
1956 this.signals.connect(this.background, 'scroll-event',
1957 (_actor, event) => {
1958 if (!inGrab && !Navigator.navigating)
1959 return;
1960 let dir = event.get_scroll_direction();
1961 if (dir === Clutter.ScrollDirection.SMOOTH)
1962 return;
1963
1964 let [gx] = event.get_coords();
1965 if (!gx) {

Callers 1

setMonitorMethod · 0.95

Calls 8

getWindowAtPointMethod · 0.95
activateWithFocusMethod · 0.95
switchLeftMethod · 0.95
switchRightMethod · 0.95
ensureViewportFunction · 0.85
disconnectMethod · 0.80
connectMethod · 0.80
destroyMethod · 0.45

Tested by

no test coverage detected