Giter Site home page Giter Site logo

Comments (9)

maweki avatar maweki commented on May 30, 2024 2

I've approved the new version on e.g.o. The bugfix is now available via the known distribution channel.

It's quite hard for us to spot such issues beforehand during the review process.

from no-title-bar.

szuliq avatar szuliq commented on May 30, 2024

Same issue here.

from no-title-bar.

nhinds avatar nhinds commented on May 30, 2024

Looking at the changes between v6 and v7, it seems like the issue is the new _enableDragOnPanel / _disableDragOnPanel functions in buttons.js that was introduced in 52ad939

If the 'button-position' setting is "HIDDEN" then the Buttons constructor calls into the this._disable() method, which blindly calls this._disableDragOnPanel(). This "helpfully" sets the global Main.panel._onButtonPress to null, because this._originalFunction was never initialized, and then tries to bind null to Main.panel.

In the meantime, if you edit ~/.local/share/gnome-shell/extensions/[email protected]/buttons.js and add return to the top of the _enableDragOnPanel and _disableDragOnPanel functions to disable them, then restart gnome-shell, the extension seems to work fine for me.

    _enableDragOnPanel: function() {
        print('IGNORING BUGGY FUNCTION');
        return;
        this._originalFunction = Main.panel._onButtonPress;

        Main.panel._onButtonPress = function(actor, event) {
            if (Main.modalCount > 0)
                return Clutter.EVENT_PROPAGATE;

            if (event.get_source() != actor)
                return Clutter.EVENT_PROPAGATE;

            let button = event.get_button();
            if (button != 1)
                return Clutter.EVENT_PROPAGATE;

            let focusWindow = Utils.getWindow(true);
            if (!focusWindow)
                return Clutter.EVENT_PROPAGATE;

            let dragWindow = focusWindow.is_attached_dialog() ? focusWindow.get_transient_for()
                                                              : focusWindow;
            if (!dragWindow)
                return Clutter.EVENT_PROPAGATE;

            let rect = dragWindow.get_frame_rect();
            let [stageX, stageY] = event.get_coords();

            let allowDrag = dragWindow.maximized_vertically &&
                            stageX > rect.x && stageX < rect.x + rect.width;

            if (!allowDrag)
                return Clutter.EVENT_PROPAGATE;

            global.display.begin_grab_op(global.screen,
                                         dragWindow,
                                         Meta.GrabOp.MOVING,
                                         false, /* pointer grab */
                                         true, /* frame action */
                                         button,
                                         event.get_state(),
                                         event.get_time(),
                                         stageX, stageY);

            return Clutter.EVENT_STOP;
        };

        Main.panel.actor.connect('button-press-event', Lang.bind(Main.panel, Main.panel._onButtonPress));
    },
    _disableDragOnPanel: function() {
        print('IGNORING BUGGY FUNCTION');
        return;
        Main.panel._onButtonPress = this._originalFunction;
        Main.panel.actor.connect('button-press-event', Lang.bind(Main.panel, Main.panel._onButtonPress));
    },

from no-title-bar.

franglais125 avatar franglais125 commented on May 30, 2024

Hello all, thanks a lot for the prompt reporting of this problem! It was not obvious to trigger (in my usage at least).

Thanks a lot @nhinds for looking into this, as I actually didn't have that much time to investigate.

I uploaded a new version to e.g.o with the fix. If anyone could confirm that the latest git code works it would be great.

I have to say I'm flattered by the great response to this issue.

Cheers everyone,
Fran

from no-title-bar.

nhinds avatar nhinds commented on May 30, 2024

After installing the current master, can confirm the extension works for me and no longer throws the Lang.bind error on startup. Thanks for the quick response :)

from no-title-bar.

szuliq avatar szuliq commented on May 30, 2024

I didn't get any info about update.

I've uninstalled and installed the extension again.

The issue is still there.

Oddly enough in the dropdown I see only the version 6.

I don't know how to check the version which I've installed.

From my experience some tools don't re-fetch the package if the version didn't change.

from no-title-bar.

franglais125 avatar franglais125 commented on May 30, 2024

@szuliq I inactivated version 7, hence the extension website should offer version 6 as an "update" (since 7 is faulty). Perhaps it isn't doing that.

  1. If you want, you can install from git, like so:
git clone https://github.com/franglais125/no-title-bar
cd no-title-bar
make && make install install

You might need some tools for this in Ubuntu:

sudo apt install git make gettext

  1. If you want to check the version information, you can run:

cat ~/.local/share/gnome-shell/extensions/[email protected]/metadata.json

from no-title-bar.

szuliq avatar szuliq commented on May 30, 2024

It is working great now!

from no-title-bar.

franglais125 avatar franglais125 commented on May 30, 2024

@maweki thanks for the quick reviews. I certainly don't expect you guys to catch all the bugs! With many features come many corner cases :)

Thanks everyone for the quick feedback! Closing this now.

from no-title-bar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.