Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Mutter 3.36.9 rebase #601

Merged
merged 36 commits into from
Jun 9, 2022
Merged

[WIP] Mutter 3.36.9 rebase #601

merged 36 commits into from
Jun 9, 2022

Conversation

clefebvre
Copy link
Member

@clefebvre clefebvre commented Oct 5, 2021

needed:

Some transition notes (of interest to xlet devs mainly):
https://docs.google.com/spreadsheets/d/1AHbuhi5bnlN_O0JP0O-rmgbN50IBHqZm74w6A1TL8Nk/edit?usp=sharing

This is just an experiment.

Loss of functionality

The following features would be lost and not brought back:

  • Window snapping (most people don't even know it's there or what the difference with tiling is)
  • Configurable window animations (no real need, if we need to bring it back, we can simplify it greatly)
  • Configurable vsync method (extremely niche)
  • Tile detection for prefixing window titles in alt-tab and window list (not important)

The following features would need to be brought back:

  • Corner tiling (mutter only has 1/2 tiling, but we can add 1/4 tiling in JS, see https://github.com/emasab/shelltile) - partly restored, issues will resizing against neighbor windows in certain layouts.
  • Window placement mode - muffin now only has "center" or "not center" -- there's no 'manual' mode. Do we want back?
  • Evaluate new keybinding actions - application-switch and -backwards, cycle bindings, 'always on top' - see keybindings.c
  • 'resize threshold' setting - a value that affects how much you need to drag a max/tiled window to break free. Overkill?
  • ignore hide-titlebar-when-maximized feature
  • workspace switching during drag with arrow keys
  • sync-to-vblank switch
  • ibus support
  • Documentation for clutter/muffin/cogl - see google doc link above for info.

Regressions

  • Existing wm and desktop settings - mostly restored.
  • Titlebar menu (removed in GNOME 3.13.2 GNOME/mutter@8640982) - using clutter menu for now

Bugs

  • Display settings do not apply

Pros

  • Marginally snappier
  • Cleaner codebase
  • Partial wayland support? (starts in 3.10)
  • GTK borders for all windows (introduced in 3.16)
  • More than 3 keyboard layouts at once. - postponed for now

Require adaptation

  • For button events, must use event.get_button() instead of checking event state

Filenames differences with 5.0

gir1.2-meta-muffin-0.0

./usr/lib/x86_64-linux-gnu/muffin/Meta-0.typelib
/usr/lib/x86_64-linux-gnu/muffin/Meta-Muffin.0.typelib

libmuffin0

clutter

	./usr/include/muffin/clutter/clutter/clutter-paint-context.h
	./usr/include/muffin/clutter/clutter/clutter-pick-context.h
	./usr/include/muffin/clutter/clutter/clutter-seat.h
	./usr/include/muffin/clutter/clutter/clutter-stage-view.h

	/usr/include/muffin/clutter-0/cally/cally-texture.h
	/usr/include/muffin/clutter-0/clutter/clutter-device-manager.h
	/usr/include/muffin/clutter-0/clutter/clutter-version.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-animatable.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-animator.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-backend.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-behaviour-depth.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-behaviour-ellipse.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-behaviour.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-behaviour-opacity.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-behaviour-path.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-behaviour-rotate.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-behaviour-scale.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-bin-layout.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-cairo-texture.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-frame-source.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-input-device.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-keysyms.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-list-model.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-main.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-media.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-model.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-score.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-shader.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-stage-manager.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-table-layout.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-texture.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-timeout-pool.h
	/usr/include/muffin/clutter-0/clutter/deprecated/clutter-util.h
	/usr/include/muffin/clutter-0/clutter/x11/clutter-x11-texture-pixmap.h

COGL


	./usr/include/muffin/cogl/cogl/cogl-depth-state.h
	./usr/include/muffin/cogl/cogl/cogl-dma-buf-handle.h
	./usr/include/muffin/cogl/cogl/cogl-pixel-format.h
	./usr/include/muffin/cogl/cogl/cogl-trace.h
	./usr/include/muffin/cogl/cogl/cogl-wayland-server.h

	/usr/include/muffin/cogl/cogl/cogl-auto-texture.h
	/usr/include/muffin/cogl/cogl/cogl-clutter.h
	/usr/include/muffin/cogl/cogl/cogl-deprecated.h
	/usr/include/muffin/cogl/cogl/cogl-depth-state.h
	/usr/include/muffin/cogl/cogl/cogl-error.h
	/usr/include/muffin/cogl/cogl/cogl-euler.h
	/usr/include/muffin/cogl/cogl/cogl-gles2.h
	/usr/include/muffin/cogl/cogl/cogl-gles2-types.h
	/usr/include/muffin/cogl/cogl/cogl-material-compat.h
	/usr/include/muffin/cogl/cogl/cogl-muffin.h
	/usr/include/muffin/cogl/cogl/cogl-pango.h
	/usr/include/muffin/cogl/cogl/cogl-primitives.h
	/usr/include/muffin/cogl/cogl/cogl-quaternion.h
	/usr/include/muffin/cogl/cogl/cogl-shader.h
	/usr/include/muffin/cogl/cogl/cogl-texture-2d-gl.h
	/usr/include/muffin/cogl/cogl/cogl-texture-3d.h
	/usr/include/muffin/cogl/cogl/cogl-texture-rectangle.h
	/usr/include/muffin/cogl/cogl/cogl-type-casts.h
	/usr/include/muffin/cogl/cogl/cogl-vector.h
	/usr/include/muffin/cogl/cogl/cogl-vertex-buffer.h
	/usr/include/muffin/cogl/cogl/deprecated/cogl-clutter-xlib.h
	/usr/include/muffin/cogl/cogl/deprecated/cogl-framebuffer-deprecated.h
	/usr/include/muffin/cogl/cogl/deprecated/cogl-vertex-buffer.h


Meta

	./usr/include/muffin/meta/barrier.h
	./usr/include/muffin/meta/compositor-mutter.h
	./usr/include/muffin/meta/meta-backend.h
	./usr/include/muffin/meta/meta-background-group.h
	./usr/include/muffin/meta/meta-background.h
	./usr/include/muffin/meta/meta-background-image.h
	./usr/include/muffin/meta/meta-close-dialog.h
	./usr/include/muffin/meta/meta-cursor-tracker.h
	./usr/include/muffin/meta/meta-dnd.h
	./usr/include/muffin/meta/meta-enum-types.h
	./usr/include/muffin/meta/meta-idle-monitor.h
	./usr/include/muffin/meta/meta-inhibit-shortcuts-dialog.h
	./usr/include/muffin/meta/meta-launch-context.h
	./usr/include/muffin/meta/meta-monitor-manager.h
	./usr/include/muffin/meta/meta-remote-access-controller.h
	./usr/include/muffin/meta/meta-selection.h
	./usr/include/muffin/meta/meta-selection-source.h
	./usr/include/muffin/meta/meta-selection-source-memory.h
	./usr/include/muffin/meta/meta-settings.h
	./usr/include/muffin/meta/meta-sound-player.h
	./usr/include/muffin/meta/meta-stage.h
	./usr/include/muffin/meta/meta-startup-notification.h
	./usr/include/muffin/meta/meta-version.h
	./usr/include/muffin/meta/meta-window-group.h
	./usr/include/muffin/meta/meta-window-shape.h
	./usr/include/muffin/meta/meta-workspace-manager.h
	./usr/include/muffin/meta/meta-x11-display.h
	./usr/include/muffin/meta/meta-x11-errors.h

	/usr/include/muffin/meta/atomnames.h
	/usr/include/muffin/meta/compositor-muffin.h
	/usr/include/muffin/meta/errors.h
	/usr/include/muffin/meta/gradient.h
	/usr/include/muffin/meta/preview-widget.h
	/usr/include/muffin/meta/screen.h

SO

	./usr/lib/x86_64-linux-gnu/muffin/libmuffin-clutter-0.so.0
	./usr/lib/x86_64-linux-gnu/muffin/libmuffin-clutter-0.so.0.0.0
	./usr/lib/x86_64-linux-gnu/muffin/libmuffin-cogl-0.so.0
	./usr/lib/x86_64-linux-gnu/muffin/libmuffin-cogl-0.so.0.0.0
	./usr/lib/x86_64-linux-gnu/muffin/libmuffin-cogl-pango-0.so.0
	./usr/lib/x86_64-linux-gnu/muffin/libmuffin-cogl-pango-0.so.0.0.0
	./usr/lib/x86_64-linux-gnu/muffin/libmuffin-cogl-path-0.so.0
	./usr/lib/x86_64-linux-gnu/muffin/libmuffin-cogl-path-0.so.0.0.0
	./usr/lib/x86_64-linux-gnu/muffin/Meta-0.gir
	./usr/lib/x86_64-linux-gnu/pkgconfig/libmuffin-0.pc

	/usr/lib/x86_64-linux-gnu/libmuffin-clutter-0.so
	/usr/lib/x86_64-linux-gnu/libmuffin-cogl-0.so
	/usr/lib/x86_64-linux-gnu/libmuffin-cogl-pango-0.so
	/usr/lib/x86_64-linux-gnu/libmuffin-cogl-path-0.so
	/usr/lib/x86_64-linux-gnu/muffin/Meta-Muffin.0.gir
	/usr/lib/x86_64-linux-gnu/pkgconfig/libmuffin.pc
	/usr/lib/x86_64-linux-gnu/pkgconfig/muffin-plugins.pc

muffin-common

   OK

muffin

OK

muffin-dbg

OK

@Fantu
Copy link
Contributor

Fantu commented Oct 6, 2021

@smcv @lestcape have you any advices that can help in this big task please?

@lestcape
Copy link

lestcape commented Oct 6, 2021

Well that it's a really big and amazing goals. I also think this is the only way to go if Cinnamon want to survive in long terms.

The most important thing now is probably fix the build, because this change need to be tested a lot and that means request the help of all possible people. It probably will require a blog post about the introduction of this changes and the instruction of how to compile and install it from source or a repository to install this branch for test purpose only.

About the windows tilling I think it's good to take a look at problems with the pop-shell implementation and probably evaluate his own code instead of the usage of the shelltiling extension.

As Clutter is internally now and at it have a lot of changes, should be good think about also make a review of the GNOME updates in St, to evaluate what should be needed to add.

Think about Wayland in this point should be just crazy, so i think is good not take anything about Wayland in account for now, just only X11.

I know @mtwebster invested a lot of time to rebuild and unify as possible the GNOME keybinding mechanisms some years ago. It should be also a point to take in consideration, as currently this change was reverted with the introduction of the new Mutter code base.

I think that all changes that involve the Cinnamon cjs code need to be address as possible with the introduction of a code hijacked like this. This should be done instead of try to fix all occurrence, because fix all occurrences can be done in new iterations subsequently if needed and then remove the hijacked code.

Any feature that should added to muffin only, should be introduced as an extension of the existing code and not as an override of it, to ensure a more soft update in the future. Should now be also more easy detect where the desktop can be needed an improved thanks to the GNOME plataform profiling initiative https://blogs.gnome.org/chergert/2020/03/14/how-to-use-sysprof-to/ as it should work now in Cinnamon.

Of course all that was my opinion, but the truth is that it makes me want to install Cinnamon and see closely all the evolution of this development in progress. Cinnamon should be really much faster after the change.

@Fantu
Copy link
Contributor

Fantu commented Oct 6, 2021

@clefebvre thanks for your big works, I taken only a fast look for now and some small things:

  • don't bump version of library with that changes don't seems good to me but if you really want do you missed to remove "Replaces: libmuffin0" in libmuffin0 part of debian/control
  • on debian/tests/ there are missed the changes mutter->muffin
  • gnome-pkg-tools and dh-sequence-gnome don't seems used (out of debian/control that have only uploaders line generated not needed here) so I think that them and debian/control.in can be remove (but shoud be tested to be sure)

@Fantu
Copy link
Contributor

Fantu commented Oct 7, 2021

@clefebvre why you removed man page (instead rename it)? if you don't want it is remained debian/muffin.postinst that use it to fix

@clefebvre
Copy link
Member Author

Hi Fantu,

We don't really use or expose muffin (the binary) to users. It's only used by us to troubleshoot issues and we never had a man page for it before.

@leigh123linux
Copy link
Contributor

leigh123linux commented Oct 7, 2021

Hi Fantu,

We don't really use or expose muffin (the binary) to users. It's only used by us to troubleshoot issues and we never had a man page for it before.

There is a man page for muffin, see https://github.com/linuxmint/muffin/tree/master/doc/man

@ItzSwirlz
Copy link

From a maintainer perspective, even if it's unused if there is a binary there should be a man page although building three muffin binary itself can be disabled

@clefebvre clefebvre mentioned this pull request Oct 8, 2021
@clefebvre
Copy link
Member Author

Still very ALPHA/broken, but it builds and installs fine now.

@Fantu
Copy link
Contributor

Fantu commented Oct 8, 2021

@clefebvre thanks, take a look to linuxmint/cinnamon#10377 to make cinnamon part of this task building also in a clean environments, even if the real cause of the issue is e3b579e (merge of -dev without add all -dev deps)

edit: Can you keep libmuffin-dev package with development thing separated (as should be) and with all correct deps please? (add -dev deps is not good, better keep -dev package separated as should be to avoid install of many packages not needed for major of users)

done here (Fantu@77b90b0) if you want cherry-pick and done also this other small commits: Fantu@2ec9296 Fantu@4441a90
and for cinnamon: Fantu/Cinnamon@55831c2
edit2: tested https://launchpad.net/~fantonifabio/+archive/ubuntu/muffin-rebase/

@Fantu
Copy link
Contributor

Fantu commented Oct 9, 2021

I added to my commit also the missed breaks/replace in -dev package to make working also upgrade (sorry for mistake)
https://github.com/Fantu/muffin/commits/fix-5.2-test
https://github.com/Fantu/Cinnamon/commits/fix-muffin-5.2-test

@Fantu
Copy link
Contributor

Fantu commented Oct 9, 2021

@clefebvre thanks for readd of the -dev package, is missed the cinnamon part, here updated build-deps/deps and meson dep: linuxmint/cinnamon#10385

for people that want do a fast test I prepared a ppa, I tested on mint 20.2, added linux mint nightly build ppa and my ppa
mint ppa have highter pinning, another changes is needed for install/upgrade cinnamon/muffin from my ppa:

sudo add-apt-repository ppa:linuxmint-daily-build-team/daily-builds
sudo add-apt-repository ppa:fantonifabio/muffin-rebase

sudo nano /etc/apt/preferences.d/fantu.pref

Package: *
Pin: release o=LP-PPA-fantonifabio-muffin-rebase
Pin-Priority: 700

sudo apt update

@mtwebster @clefebvre I did a fast test, I had 2 crash on cinnamon-settings for missed schema one with "workspace-cycle" and one "tile-hud-threshold" (probably already know them), out of settings and know bugs no crash and the performances seems better
small advice: don't force file change/rename where don't needed which could be counterproductive

@clefebvre
Copy link
Member Author

@Fantu thanks, I wouldn't worry about csettings just yet. There are so many bugs with the core desktop still, one thing at a time :)

@Fantu
Copy link
Contributor

Fantu commented Oct 10, 2021

I updated my ppa with latest muffin/cinnamon fixes and did another fast test (only in a vm for now)
In .xsession-errors I see many of:

(cinnamon:1198): Clutter-CRITICAL **: 21:55:55.404: clutter_actor_get_transformed_size: assertion 'CLUTTER_IS_ACTOR (self)' failed

(cinnamon:1198): Cjs-CRITICAL **: 21:55:55.404: Object Clutter.Actor (0x55c9d6879410), has been already deallocated — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
== Stack trace for context 0x55c9d617f6a0 ==
#0   7ffeac7b8d40 b   /usr/share/cinnamon/js/ui/layout.js:725 (3f2a6b65cd80 @ 1098)
#1   7ffeac7b8e00 b   self-hosted:850 (3d32955c3bf0 @ 398)

(cinnamon:1198): Clutter-CRITICAL **: 21:55:55.405: clutter_actor_get_paint_visibility: assertion 'CLUTTER_IS_ACTOR (actor)' failed

I don't have time now to do a check about it if related to muffin rebase and if I can do a fix, I posted if can be useful, if you need a specific test for help or something else try to tell and I'll do if I'll have enough time, for now I'll try at least to update ppa for anyone want test it in easy/fast way
@clefebvre @mtwebster @JosephMcc thanks for your works

@JosephMcc
Copy link
Contributor

@Fantu I think some of those are coming from an issue with the backgrounds. When I first start I get a black background and those errors. But if I restart cinnamon, I get a proper background and those errors seem to go away.

@lestcape
Copy link

lestcape commented Oct 13, 2021

Well i installed this branch over an updated Mint Uma virtual machine (with VirtualBox) using this repository: https://launchpad.net/~kelebek333/+archive/ubuntu/muffin-3.36rebase-test So, @Fantu, maybe is better that you make your repository private, to not introduce more things to take on account in a user report. This because I think that to have two different source, form where install this could be a little complicate to be handled.

Point apart, latest version of Uma is broken in VirtualBox running with accelerate graphics (acceleration is working well with this branch).

I can reproduced the bug "Laggy category change in application menu (vector box, need to fix st-polygon build)" and it remember me an already problem that i faced with the cinnamon menu, running in mutter some time ago. Please see: https://bugzilla.gnome.org/show_bug.cgi?id=778158 as probably it could help. Anyway also if this fix is apply, sure get a focus chain when we only need the next visible actor it's not a good idea. Also it's not a good idea simulate a focus change as currently is doing the cinnamon menu, because this is not friendly with the accessibility. It's preferable really move the focus and avoid all that at once and then fix orca to be used for users with "different abilities".

@Fantu
Copy link
Contributor

Fantu commented Oct 13, 2021

@lestcape uma have already daily build packages by default? I saw that kelebek333 ppa don't depend on dailybuild and don't have full packages updated from git in it, on my ppa I keep daily build as dep for rebuild only cinnamon and muffin for this task (like when this will be merged and also because cinnamon also include other commits for next version) and I wrote instructions for use it on a post above (now I'll also include in ppa description to avoid mistake). and about my additional commits I did only few small things to make cinnamon build and very small packaging improvements awaiting that will be merged, should be nothing that change the tests, or I'm missing something?

edit: about my vm (with kvm) don't going to fallback anymore in latest test with rebase (with latest cinnamon commits of latest 2 days)

@lestcape
Copy link

lestcape commented Oct 13, 2021

Seem to be that the _keepMaskActive is getting a wrong value and is jumping between true and false because the VectorMask was disabled and enabled several times during the category-box motion event in a direction that this should not happen, causing a lot of changes in the actor reactivity, what seem to cause also a theme-node update for all category buttons.

@Fantu what i said was just a suggestion... It's fine to me if you think differently.

I saw that kelebek333 ppa don't depend on dailybuild and don't have full packages updated from git in it,

I think it depend. At less apparently is updated with this branch otherwise I would not have talked about it. Sorry if im wrong.

Edit: I see now what you said and why, so, I understand what you do now. If i want to use your repository i also will need the daily-build repository, but not if i use the kelebek333 repo, because it include a copy of the other dependencies from the daily-build, but in an static way, that need to be updated manually. I don't know what approach should be better for test this, but as they are that way we can not ensure they will produced the same result for same test, because other the daily-build package can change in the middle and affect the result of the test. To be honest I didn't know how your repository would work with only two packages. Now I understand that the daily-build had to be added before.This was my bad, and the reason of why i selected the other repo.

should be nothing that change the tests, or I'm missing something?

I don't know what could be the difference, that is the point. I only saw that kelebek333 is handled more packages that what i will get if i used your repository and the duplicate effort is not a good thing. That was all. I ask only to you, because i don' t know who is kelebek333...

@lestcape
Copy link

lestcape commented Oct 14, 2021

This is my proposition to fix the vector-box _keepMaskActive jumping issue:

The reason of why _keepMaskActive is jumping between true and false is because the current code is enabled the VectorMask without to really check if we need to enable it. To check that, we first need to have a the information of the vector_mask (this.vector_mask_info) to then check it, so the _categoryMotionEvent function should be convert to something like this:

_categoryMotionEvent(actor, event) {
    // Always keep the mask engaged - motion-events on the category buttons
    // trigger this.

    if (this.vector_update_loop == 0) {
        if (!this.vector_mask_info) {
            this.vector_mask_info = this._getNewVectorInfo(actor);
        }
        if (this._keepMaskActive()) {
            this._enableVectorMask(actor);
        }
    }

    return Clutter.EVENT_PROPAGATE;
}

Unfortunately, this is not enough, because there are another problem. The problem is that we are using the broken function calc_angle to finding our angle direction. The broken part of the function is here:

if (x == 0 || y == 0) {
    return 0;
}

because in our cartesian system references when y == 0 the angle is not always 0 because depend of the sign of x it can be 0 or 180 degrees. The same occurs when x == 0 the angle is not 0 is instead 90 or -90 degrees depending of the y value, if is positive or negative. So to fix that we need to replace the calc_angle function with this one:

function calc_angle(x, y) {
    let r = Math.atan2(y, x) * (180 / Math.PI);
    return r;
}

Please note that Math.atan2 is giving us the right value automatically, so the right thing to do here is not do anything more.

Here, the problem of the menu was gone, but i think that we also can add some improvements. For example:
The logs are done that way:

log(`${this.vector_mask_info.top_angle.toFixed()} <---${angle.toFixed()}---> ${this.vector_mask_info.bottom_angle.toFixed()} - Continue? ${ret}`);

and this not get us an easy way to know if the angle is negative or positive because the separator <--- have the same character of the negative sign.

Another improve is just to add a gap to our angle to ensure that the corner cases do not activate the vectorbox. I think that 10 degrees is enough. So, we can then check if our angle is in range in this way instead:

ret = angle <= this.vector_mask_info.top_angle + 10 &&
      angle >= this.vector_mask_info.bottom_angle - 10;

@lestcape
Copy link

lestcape commented Oct 14, 2021

Please note this another bug: The global.display.add_keybinding function only add a keybinding to the display. This means that if the stage have the focus the keybinding event will be intercepted by clutter and then it will not be propagate to the display, what means the display will never be informed about the event and then the callback of the keybinding will never execute. This issue can directly be checked with the menu. The menu hotkey open the menu but the menu can not be closed with the same hotkey once it is open. This is because the stage have the focus and then the event it is not propagate to the display.

Edit:
Please note that the fix is in Main, but the Meta.KeyBindingAction.CUSTOM is undefined. It can be replaced with check if the keybinding_action is greater than the Meta.KeyBindingAction.LAST, but also global.display.keybinding_action_invoke_by_code is undefined. So it should be re-implemented again. Probably like this:

void
meta_display_keybinding_action_invoke_by_code (MetaDisplay  *display,
                                               unsigned int  keycode,
                                               unsigned long mask)
{ 
  MetaKeyBindingManager *keys = &display->key_binding_manager;
  xkb_keycode_t code = (xkb_keycode_t) keycode;
  MetaResolvedKeyCombo resolved_combo = { &code, 1 };

  resolved_combo.mask = mask_from_event_params (keys, mask);
  
  MetaKeyBinding *binding = get_keybinding (keys, resolved_combo);

  if (binding)
    invoke_handler (display, binding->handler, null, null, binding);
}

Another possibility should be also add the action and the handler to the internal _bindings object of the KeybindingManager:

this._bindings[name] = settings;
this._bindings[name].action = ret;
this._bindings[name].handler = handler;

And then in Main instead of:

if (action == Meta.KeyBindingAction.CUSTOM) {
    global.display.keybinding_action_invoke_by_code(keyCode, modifierState);
}

We can do:

if (action > Meta.KeyBindingAction.LAST) {
    for (let name in keybindingManager._bindings) {
        if (keybindingManager._bindings[name] && keybindingManager._bindings[name].action == action) {
            keybindingManager._bindings[name].handler();
            break;
        }
    }
}

@UnisTorvalds
Copy link

Thank you @clefebvre for your continued maintenance of Mint/Cinnamon! I'm a multiple time $ contributor to the project.

Not sure if this is the appropriate venue for this, but I just wanted to cast my vote on 'resize threshold' setting. I do use and appreciate this setting. I find it especially useful with low-precision laptop touchpads.
Cheers!

mtwebster and others added 22 commits June 8, 2022 20:31
Fractional scaling should be picked up ok, but base scale is
dropped - muffin can figure out where this should be - maybe
we'll revisit it.

This hasn't been tested against complex, multi-monitor, multi-
scale configurations, but should work fine.
Currently this is 48px by default which is triggered too easily just moving
windows normally around the screen. Change it so that it's only triggered
when moving the mouse right against the top edge.
Instead of it being based on the shake-loose threshold, it's traditionally
been 1px wide on extreme edges and 5px on shared edges. This restores
that behavior.
- remove unused build options, set remaining ones to our preferred
  defaults.
- clean up debian/rules some more
compositor so they can be managed properly with the background.

Add a way to control the desklet container level.

This wasn't an issue before, as the desklet container wasn't
part of the window group, but now it is so we need to handle
it during stack updating.
d/rules: restore armel and armhf default_driver change
keyboard device is used.

ref: https://gitlab.gnome.org/GNOME/mutter/-/issues/398

New muffin uses xinput2 instead of xlib for doing key grabs,
and is incredibly slow at it in comparison. NewKeyboardNotify
can be sent when using auxillary mouse buttons or the volume
encoder on a keyboard. It ends up causing a very noticeable
UI freeze when it happens. This seems to only affect nvidia.
style classes and elements changing.

Muffin only uses a very narrow set of theme elements, and they
chain from the ssd window background changing. This doesn't happen
when we switch from Mint-Y to Mint-Y-Blue, for example, as they
all have the same background.
display: Add helper functions for translating between logical and
xinerama monitor numbers.

Monitor 0 is traditionally the primary monitor. Logical monitors
don't work this way - if you change the primary, its number stays
the same. Fortunately the underlying x number is still available.

This may eventually be complicated by monitors that allow multiple
logical inputs (tiling), but I have none to test with.
@ItzSwirlz
Copy link

Nice!

@Fantu you said you were going to adjust the hardening in Debian?

@Fantu
Copy link
Contributor

Fantu commented Jun 9, 2022

@ItzSwirlz as you can see debian/rules of muffin rebase there is already all hardening enabled (same of mutter), now that code are improved with the rebase and on tests I did for now I not found issue related so will be applied also to muffin 5.4 debian package

@lestcape
Copy link

lestcape commented Aug 9, 2022

About window corner tiling, you probably want to wait for GNOME: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2512#note_1523744 instead of make it in js with a bad performance...

@lestcape
Copy link

lestcape commented Aug 9, 2022

Also you probably want to fork mutter again to a point where you can add this: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441 Have 60 FPS instead of 30 FPS in x11 seem to be as very good improve.

ventureoo added a commit to ventureoo/ARU that referenced this pull request Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants