Commit Graph

31 Commits

Author SHA1 Message Date
Florian Müllner
a42f7c2384 cleanup: Use type-safe comparisons
We have been using type-safe comparisons in new code for quite a while
now, however old code has only been adapted slowly.

Change all the remaining bits to get rid of another legacy style
difference.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
2023-08-09 15:10:38 +00:00
Florian Müllner
9a3913d4a0 cleanup: Use consistent 4-space indent
This is another bit where we've made good progress, and just need
a final push to complete the transition.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
2023-08-09 15:10:37 +00:00
Florian Müllner
6a22af83dc cleanup: Always use single quotes
We have made good progress with transitioning to the new style,
to the point where we can complete it with a final push.

Start with changing the remaining places that still use double
quotes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
2023-08-09 15:10:37 +00:00
Evan Welsh
a751e213f6 js: Port to modules
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1499>
2023-08-06 13:02:49 +02:00
Evan Welsh
1e9b906cbc js: Split gi imports to be on new lines to prepare for ES modules
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2794>
2023-06-21 04:50:33 -07:00
Jonas Ådahl
c1d66af4b9 js: Get monitor manager from backend
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2557>
2022-12-16 22:12:59 +01:00
Cenk Uluisik
b832324ede introspect: Add WindowsChanged signal
The screencast portal supports recording a single window,
and presents a list of open windows when that option is
selected. To allow updating that list when windows are
opened or closed, add a new "WindowsChanged" signal that
the portal can listen to.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2229>
2022-03-08 16:31:20 +00:00
Sebastian Keller
85609a232d util: Wait for initial name owners in DBusSenderCheck before checking
Otherwise an allowed caller might get rejected if the call is right
after a gnome-shell restart and the watchers have not finished running
their callbacks yet.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4813
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2048>
2021-12-04 16:57:25 +00:00
Florian Müllner
2a3e297218 introspect: Split out DBusSenderChecker
Restricting callers to a list of allowed senders is useful for
other D-Bus services as well, so split out the existing code
into a reusable class.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3943

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1970>
2021-09-03 21:34:58 +00:00
Florian Müllner
317f0f5fe0 introspect: Use MetaContext:unsafe-mode instead of setting
The property was added precisely for this purpose, except that its
name isn't tied to the introspect API.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3943

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1970>
2021-09-03 21:34:58 +00:00
Florian Müllner
3b9e672a09 introspect: Make invocation check error-based
If we throw an error when the invocation isn't allowed instead of
returning false, we can simply return that error instead of duplicating
the error handling.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1970>
2021-09-03 21:34:58 +00:00
Georges Basile Stavracas Neto
f5259a5ce4 introspect: Allowlist GNOME portal
It too implements app listing and introspection, so list it in the allowlist.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1894>
2021-06-21 16:32:50 -03:00
Florian Müllner
8a47f1c667 cleanup: Remove empty leading/trailing lines in blocks
gjs added a new rule to its eslint ruleset that forbids "block padding",
so make sure we conform to that rule before syncing up the configuration.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1498
2020-11-16 18:04:23 +00:00
Olivier Fourdan
3541a57570 cleanup: remove controversial naming
Replace "whitelist" and "blacklist" with "allow" and "deny" in variable
naming, which better represents the purpose of those variables.

There is no functional change.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1393
2020-08-04 13:24:50 +02:00
Jonas Ådahl
a9b803f075 introspect: Introspect screen size
To be used by the screen cast service.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1372
2020-07-31 10:51:12 +02:00
Jonas Ådahl
9ab0071aa5 introspect: Add AnimationsEnabled property
While the gsetting is available for all who needs it, the Shell might
override it given various hueristics. Expose the decision made by the
Shell via a new property.

Intended to be used by gsd-xsettings as well as xdg-desktop-portal-gtk.

This also add a version property to the API, so that semi external
services (xdg-desktop-portal-gtk) can detect what API is expected to be
present.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/757
2020-02-20 11:14:55 +00:00
Jonas Ådahl
cf39b2db87 introspect: Rename variable
It was too generic, and would conflict with a StSettings variable.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/757
2020-02-20 11:14:55 +00:00
Jonas Ådahl
059fb5c7cb introspect: Add helper to check method call permission
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/757
2020-02-20 11:14:55 +00:00
Florian Müllner
eee1ab4890 introspect: Fix whitelist check
The whitelist is a list of well-known D-Bus names, which we then search
for the unique name we get from the method invocation - unsuccesfully.

Fix this by watching the bus for any name in the whitelist in order
to maintain a map from wel-known to unique name that we can use for
matching.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1916
2019-11-25 20:00:10 +01:00
Florian Müllner
e44adb92cf cleanup: Avoid unnecessary parentheses
Extra parentheses usually add noise rather than clarity, so avoid
them.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805
2019-11-11 19:25:14 +00:00
Florian Müllner
ebf77748a8 cleanup: Require "dangling" commas
Since ES5, trailing commas in arrays and object literals are valid.
We generally haven't used them so far, but they are actually a good
idea, as they make additions and removals in diffs much cleaner.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805
2019-11-11 19:25:14 +00:00
Florian Müllner
07cc84f632 cleanup: Only omit braces for single-line blocks
Braces can be avoided when a block consists of a single statement,
but readability suffers when the statement spans more than a single
line.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805
2019-11-11 19:25:14 +00:00
Jonas Ådahl
e0947b01bd introspect: Check whitelist also for GetRunningWindows()
Otherwise the xdg-desktop-portal-gtk screen cast widget won't work.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/732
2019-09-18 16:17:25 +00:00
Florian Müllner
e357559582 cleanup: Mark globals used from other modules as exported
eslint cannot figure out that those symbols are used from other modules
via imports, so they trigger unused-variable errors. To fix, explicitly
mark those symbols as exported.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
1398aa6562 style: Fix indentation errors
While we have some style inconsistencies - mostly regarding split lines,
i.e. aligning to the first arguments vs. a four-space indent - there are
a couple of places where the spacing is simply wrong. Fix those.

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/608
2019-07-02 12:17:46 +00:00
Florian Müllner
33f5bb39cd introspect: Include sandboxed-app-id as well
App IDs in gnome-shell don't match AppStream, Flatpak or Snap IDs. For the
desktop portal, the latter two are more relevant, so include it in the
returned information.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1289
2019-05-16 13:02:08 +00:00
Florian Müllner
a1c3900630 introspect: Remove unused variable
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1289
2019-05-16 13:02:08 +00:00
Florian Müllner
fd50b9a45e cleanup: Use destructuring for imports from GI
This is *much* nicer than repetitive "imports.gi" lines ...

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/399
2019-02-09 07:39:20 +01:00
Florian Müllner
bacfdbbb03 cleanup: Port non-GObject classes to JS6 classes
ES6 finally adds standard class syntax to the language, so we can
replace our custom Lang.Class framework with the new syntax. Any
classes that inherit from GObject will need special treatment,
so limit the port to regular javascript classes for now.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/361
2019-01-25 14:02:44 +00:00
Olivier Fourdan
ca4e563f55 introspect: Add GetWindows method
The `GetWindows` method gives access to the list of windows for each
application with some of their properties, so utilities such as dogtail
can pick the window of their choice to interfere with using the provided
window id.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/326
2019-01-09 10:13:45 +01:00
Jonas Ådahl
8be0c5a58a Add app introspection API
Add a D-Bus API that allows the API user to introspect the application
state of the shell. Currently the only exposed information is list of
running applications and which one is active (i.e. has focus).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/326
2019-01-09 10:13:45 +01:00