Skip to content

Commit

Permalink
Adapt to new plugin, meta, clutter, cogl api.
Browse files Browse the repository at this point in the history
See: https://bit.ly/3Q8ZBts (Google Sheet) for some transition info.

- MetaScreen is gone, replaced with CinnamonScreen to maintain
  compatibility. It should be functionally identical but it is still
  encouraged to migrate to using MetaDisplay and MetaWorkspaceManager
  (accessible thru the global object).
- windowManager: Rework animations
- Use gsound to play sounds in cinnamon-settings.
- rename keyboard.js to virtualKeyboard.js.
- cs_tiling: remove HUD setting.
- enabling/disabling of effects, export a dbus property to tell
  csd-xrandr about effects state so gtk effects can mirror the behavior.
- Remove gsettings overrides. They're in cjs now
- Restore Clutter.Point, Clutter.Vertex as aliases of graphene
  counterparts.
- cs_themes: Remove the window border setting - Window borders are
  now themed by the choses gtk theme so this setting is no longer needed.
- Let muffin manage stacking of the background actor, desklet and
  desktop containers.
- Get rid of NPOT wrapper code - Non-npot hardware is no longer supported -
  (pre-opengl 2.0: ~ 2004)
  • Loading branch information
mtwebster committed Jun 9, 2022
1 parent 1486bf7 commit bef2930
Show file tree
Hide file tree
Showing 158 changed files with 9,201 additions and 7,097 deletions.
2 changes: 1 addition & 1 deletion calendar-server/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

server_launcher_conf = configuration_data()
server_launcher_conf.set('MUFFINLIBDIR', muffinlibdir)
server_launcher_conf.set('MUFFINLIBDIR', muffin_typelibdir)
server_launcher_conf.set('PKGLIBDIR', join_paths(prefix, pkglibdir))
server_launcher_conf.set('LIBEXECDIR', join_paths(prefix, libexecdir))

Expand Down
65 changes: 53 additions & 12 deletions data/org.cinnamon.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,20 @@

<key name="desktop-effects-workspace" type="b">
<default>true</default>
<summary>Enable desktop effects on the workspace</summary>
<summary>Enable desktop effects in the Cinnamon ui</summary>
<description>
This affects switching workspaces, expo and scale.
</description>
</key>

<key name="desktop-effects" type="b">
<default>true</default>
<summary>Enable desktop effects</summary>
<description>
Whether to enable desktop effects and window animations.
</description>
</key>

<key type="s" name="desktop-effects-close">
<default>"traditional"</default>
<summary>Effect used when closing windows</summary>
Expand All @@ -200,32 +208,55 @@
<default>"traditional"</default>
<summary>Effect used when mapping windows</summary>
<description>
An effect: traditional, fly, move, none
An effect: traditional, fly, fade, none
</description>
</key>

<key type="s" name="desktop-effects-minimize">
<default>"traditional"</default>
<summary>Effect used when minimizing windows</summary>
<description>
An effect: traditional, fly, none
An effect: traditional, fly, fade, none
</description>
</key>

<key type="b" name="desktop-effects-maximize">
<default>false</default>
<summary>Whether to show an animation when maximizing windows</summary>
<key type="b" name="desktop-effects-change-size">
<default>true</default>
<summary>Whether to show an animation when unmaximizing/tiling/snapping windows</summary>
<description>
</description>
</key>

<key type="b" name="desktop-effects-change-size">
<default>true</default>
<summary>Whether to show an animation when unmaximizing/tiling/snapping windows</summary>
<key type="s" name="desktop-effects-sizechange-effect">
<default>"scale"</default>
<summary>Effect used when maximizing windows</summary>
<description>
An effect: none
</description>
</key>

<key name="desktop-effects-sizechange-transition" type="s">
<default>"easeInQuad"</default>
<summary>Transition used when maximizing windows</summary>
<description>
A Tweener transition
</description>
</key>

<key type="i" name="desktop-effects-sizechange-time">
<default>100</default>
<summary>Duration of the effect (in milliseconds)</summary>
<description>
Duration of the effect (in milliseconds)
</description>
</key>

<key type="i" name="window-effect-speed">
<default>1</default>
<range min="0" max="2"/>
<summary>Speed multiplier for window-effects</summary>
</key>

<key type="b" name="startup-animation">
<default>true</default>
<summary>Whether the startup animation is enabled</summary>
Expand Down Expand Up @@ -873,10 +904,20 @@
</key>
</schema>

<schema id="org.cinnamon.keybindings" path="/org/cinnamon/keybindings/">
<key name="custom-list" type="as">
<schema id="org.cinnamon.runtime-keybindings" path="/org/cinnamon/runtime-keybindings/">
<key name="placeholder" type="b">
<default>false</default>
</key>
</schema>

<schema id="org.cinnamon.runtime-keybindings.runtime-keybinding">
<key name="bindings" type="as">
<default>[]</default>
<summary>deprecated - moved to org.cinnamon.desktop.keybindings</summary>
<summary>Keybinding array for runtime keybinding.</summary>
</key>
<key name="action-id" type="i">
<default>0</default>
<summary>Action id for keybinding</summary>
</key>
</schema>

Expand Down
13 changes: 1 addition & 12 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Depends:
libcinnamon-menu-3-0-dbg (>= 4.8),
libcjs-dbg (>= 4.8),
libcvc-dbg,
muffin-dbg,
# muffin-dbg,
nemo-dbg,
${misc:Depends},
Description: Debugging symbols for the Cinnamon desktop
Expand All @@ -157,14 +157,3 @@ Description: Debugging symbols for the Cinnamon desktop
.
This package contains the debugging symbols.

Package: cinnamon-doc
Section: doc
Architecture: all
Multi-Arch: foreign
Depends: devhelp, ${misc:Depends}
Description: Cinnamon documentation
Cinnamon is a modern Linux desktop which provides advanced innovative
features and a traditional user experience. It's easy to use, powerful
and flexible.
.
This package contains the code documentation for various Cinnamon components.
1 change: 0 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
override_dh_auto_configure:
dh_auto_configure -- \
--libexecdir=/usr/libexec/cinnamon \
-D docs=true \
-D deprecated_warnings=false \
-D py3modules_dir=/usr/lib/python3/dist-packages

Expand Down
2 changes: 1 addition & 1 deletion files/usr/bin/cinnamon2d
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
CLUTTER_PAINT=disable-culling LIBGL_ALWAYS_SOFTWARE=1 CINNAMON_SOFTWARE_RENDERING=1 CINNAMON_2D=1 CINNAMON_SLOWDOWN_FACTOR=0.0001 MUFFIN_NO_SHADOWS=1 CLUTTER_DEFAULT_FPS=15 cinnamon $@
CLUTTER_PAINT=disable-culling LIBGL_ALWAYS_SOFTWARE=1 CINNAMON_2D=1 CINNAMON_SLOWDOWN_FACTOR=0.0001 MUFFIN_NO_SHADOWS=1 CLUTTER_DEFAULT_FPS=15 cinnamon $@
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ class CinnamonCalendarApplet extends Applet.TextApplet {
}));

this.go_home_button.connect("button-press-event", Lang.bind(this, (actor, event) => {
if (event.get_button() == Clutter.BUTTON_PRIMARY) {
return Clutter.EVENT_STOP;
}
}));

this.go_home_button.connect("button-release-event", Lang.bind(this, (actor, event) => {
if (event.get_button() == Clutter.BUTTON_PRIMARY) {
// button immediately becomes non-reactive, so leave-event will never fire.
actor.remove_style_pseudo_class("hover");
Expand Down
15 changes: 3 additions & 12 deletions files/usr/share/cinnamon/applets/calendar@cinnamon.org/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ class Calendar {
// Remove everything but the topBox and the weekday labels
let children = this.actor.get_children();
for (let i = this._firstDayIndex; i < children.length; i++)
children[i].destroy();
this.actor.remove_actor(children[i]);

// Start at the beginning of the week before the start of the month
let beginDate = new Date(this._selectedDate);
Expand All @@ -430,11 +430,8 @@ class Calendar {
let row = 2;

while (true) {
let group = new Clutter.Actor(
{
layout_manager: new Clutter.FixedLayout()
}
);
let group = new Cinnamon.Stack();

let button = new St.Button(
{
label: iter.getDate().toString(),
Expand All @@ -446,12 +443,6 @@ class Calendar {
let dot_box = new Cinnamon.GenericContainer(
{
style_class: "calendar-day-event-dot-box",
constraints: new Clutter.BindConstraint(
{
source: group,
coordinate: Clutter.BindCoordinate.WIDTH
}
)
}
);
dot_box.connect('allocate', this._allocate_dot_box.bind(this));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,8 @@ class EventList {
this.events_scroll_box = new St.ScrollView(
{
style_class: 'calendar-events-scrollbox vfade',
hscrollbar_policy: Gtk.PolicyType.NEVER,
vscrollbar_policy: Gtk.PolicyType.AUTOMATIC,
hscrollbar_policy: St.PolicyType.NEVER,
vscrollbar_policy: St.PolicyType.AUTOMATIC,
enable_auto_scrolling: true
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class CinnamonFavoriteApplet extends Applet.IconApplet {

this.favoritesBox = new St.BoxLayout({ vertical:true });
this.favoritesScrollBox.add_actor(this.favoritesBox);
this.favoritesScrollBox.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
this.favoritesScrollBox.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
this.favoritesScrollBox.add_style_class_name("vfade");

this.settings = new Settings.AppletSettings(this, metadata.uuid, this.instance_id);
Expand All @@ -72,7 +72,7 @@ class CinnamonFavoriteApplet extends Applet.IconApplet {

this.favorites_id = this.favorites.connect('changed', ()=>this._refreshFavorites());

global.settings.connect('changed::panel-edit-mode', ()=>this._on_panel_edit_mode_changed());
this.edit_mode_id = global.settings.connect('changed::panel-edit-mode', () => this._on_panel_edit_mode_changed());
}

settings_changed() {
Expand All @@ -90,6 +90,11 @@ class CinnamonFavoriteApplet extends Applet.IconApplet {
this.favorites_id = 0;
}

if (this.edit_mode_id > 0) {
global.settings.disconnect(this.edit_mode_id);
this.edit_mode_id = 0;
}

this.favorites = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ class AppGroup {
let rect = new Meta.Rectangle();
[rect.x, rect.y] = this.actor.get_transformed_position();
[rect.width, rect.height] = this.actor.get_transformed_size();

each(this.groupState.metaWindows, (metaWindow) => {
if (metaWindow) {
metaWindow.set_icon_geometry(rect);
Expand Down Expand Up @@ -805,7 +804,7 @@ class AppGroup {
if (!this.rightClickMenu.isOpen) {
this.listState.trigger('closeAllRightClickMenus', () => {
this.listState.trigger('closeAllHoverMenus', () => {
this.rightClickMenu.open();
this.rightClickMenu.toggle();
});
});
} else {
Expand Down Expand Up @@ -893,7 +892,7 @@ class AppGroup {
this.signals.connect(metaWindow, 'notify::gtk-application-id', (w) => this.onAppChange(w));
this.signals.connect(metaWindow, 'notify::wm-class', (w) => this.onAppChange(w));

this.signals.connect(metaWindow, 'icon-changed', (w) => this.setIcon(w));
this.signals.connect(metaWindow, 'notify::icon', (w) => this.setIcon(w));

if (metaWindow.progress !== undefined) {
// Check if GWL is starting with pre-existing windows that have progress,
Expand Down Expand Up @@ -1147,7 +1146,12 @@ class AppGroup {
}
this.rightClickMenu.destroy();
}
if (this.hoverMenu) this.hoverMenu.destroy();

if (this.hoverMenu) {
Main.layoutManager.removeChrome(this.hoverMenu.actor);
this.hoverMenu.destroy();
}

this.listState.trigger('removeChild', this.actor);
this.actor.destroy();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class AppMenuButtonRightClickMenu extends Applet.AppletPopupMenu {
}
}
// Workspace
if ((length = global.screen.n_workspaces) > 1) {
if ((length = global.workspace_manager.n_workspaces) > 1) {
if (this.groupState.lastFocused && this.groupState.lastFocused.is_on_all_workspaces()) {
item = createMenuItem({label: _('Only on this workspace')});
this.signals.connect(item, 'activate', () => {
Expand All @@ -130,7 +130,7 @@ class AppMenuButtonRightClickMenu extends Applet.AppletPopupMenu {

let connectWorkspaceEvent = (ws, j) => {
this.signals.connect(ws, 'activate', () => {
this.groupState.lastFocused.change_workspace(global.screen.get_workspace_by_index(j));
this.groupState.lastFocused.change_workspace(global.workspace_manager.get_workspace_by_index(j));
});
};
for (let i = 0; i < length; i++) {
Expand Down Expand Up @@ -370,11 +370,15 @@ class AppMenuButtonRightClickMenu extends Applet.AppletPopupMenu {

onToggled(actor, isOpening) {
this.state.set({menuOpen: this.isOpen});
}

if (!isOpening) return;
toggle() {
if (!this.isOpen) {
this.removeAll();
this.populateMenu();
}

this.removeAll();
this.populateMenu();
Applet.AppletPopupMenu.prototype.toggle.call(this);
}

toggleAutostart() {
Expand Down Expand Up @@ -704,16 +708,16 @@ class WindowThumbnail {
}
// Create our own thumbnail if it doesn't exist
if (this.metaWindowActor) {
this.signals.disconnect('size-changed', this.metaWindowActor);
this.signals.disconnect('notify::size', this.metaWindowActor);
} else {
this.metaWindowActor = this.metaWindow.get_compositor_private();
}
if (this.metaWindowActor && !this.metaWindowActor.is_finalized()) {
this.signals.connect(this.metaWindowActor, 'size-changed', () => this.refreshThumbnail());
this.signals.connect(this.metaWindowActor, 'notify::size', () => this.refreshThumbnail());

let windowTexture = this.metaWindowActor.get_texture();
if (!windowTexture) return;
let [width, height] = windowTexture.get_size();
let [width, height] = this.metaWindowActor.get_size();
let scale = Math.min(1.0, thumbnailWidth / width, thumbnailHeight / height) * global.ui_scale;
width = Math.round(width * scale);
height = Math.round(height * scale);
Expand All @@ -724,8 +728,8 @@ class WindowThumbnail {
this.thumbnailActor.child.width = width;
this.thumbnailActor.child.height = height;
} else {
this.thumbnailActor.child = new Clutter.Clone({
source: windowTexture,
this.thumbnailActor.child = new Clutter.Actor({
content: windowTexture,
reactive: true,
width,
height
Expand Down Expand Up @@ -818,11 +822,12 @@ class WindowThumbnail {
this.metaWindowActor = this.metaWindow.get_compositor_private();
}
this.state.set({
lastOverlayPreview: new Clutter.Clone({
source: this.metaWindowActor.get_texture(),
lastOverlayPreview: new Clutter.Actor({
content: this.metaWindowActor.get_texture(),
opacity: 0
})
});

let [x, y] = this.metaWindowActor.get_position();
this.state.lastOverlayPreview.set_position(x, y);
global.overlay_group.add_child(this.state.lastOverlayPreview);
Expand Down
Loading

0 comments on commit bef2930

Please sign in to comment.