Giter Site home page Giter Site logo

Comments (8)

NamorNiradnug avatar NamorNiradnug commented on July 22, 2024

Seems like signal_draw doesn't emit and the margin doesn't update (from here).
And the signal doesn't emit because queue_draw() from here doesn't work when the panel is entirely hidden.

from wf-shell.

ammen99 avatar ammen99 commented on July 22, 2024

Ah, I see. Wayfire doesn't send a wl_surface.frame_done (which would trigger signal_draw in gtk) event because the panel is fully hidden. That seems the correct behavior from Wayfire's side.

Based on the information you have provided, I have the feeling that the problem is when m_do_show() executes, it sets the margin to y_position which is animated from its fully hidden state to -1. So in the very first step, we update the margin to fully hidden .. and the next step is never reached, because the panel is hidden and never gets a frame done event. I guess the solution would be to animate the y_position from max(fully-hidden position + 1, y_position.current_value) to 0 (speaking in pseudo-code), do you mind trying this out to see how well it works?

from wf-shell.

NamorNiradnug avatar NamorNiradnug commented on July 22, 2024

Changing this line to y_position.animate(y_position + 1, 0); doesn't work.

from wf-shell.

NamorNiradnug avatar NamorNiradnug commented on July 22, 2024

Inserting something like this:

margin_update = Glib::signal_timeout().connect(
    [=] {
        gtk_layer_set_margin(gobj(), GTK_LAYER_SHELL_EDGE_BOTTOM, y_position);
        std::cout << y_position << std::endl;
        return true;
    }, 30);

into this constructor (margin_update is a WayfireAutohidingWindow member) also doesn't fix the thing. Margin is updated, but the panel is still invisible.

from wf-shell.

NamorNiradnug avatar NamorNiradnug commented on July 22, 2024

Does wayfire continue to draw/update a window after it is invisible/hidden once?

from wf-shell.

ammen99 avatar ammen99 commented on July 22, 2024

Changing this line to y_position.animate(y_position + 1, 0); doesn't work.

After a bit of digging in gtk-layer-shell I think I know what the problem is. set_margin does not commit the wl_surface, so Wayfire never sees that the panel has become visible. As a result, the panel never gets a wl_surface.frame event, never renders, etc. I think that adding a wl_surface_commit() call after setting the margin could work.

from wf-shell.

NamorNiradnug avatar NamorNiradnug commented on July 22, 2024

Changing this line to y_position.animate(y_position + 1, 0); doesn't work.

After a bit of digging in gtk-layer-shell I think I know what the problem is. set_margin does not commit the wl_surface, so Wayfire never sees that the panel has become visible. As a result, the panel never gets a wl_surface.frame event, never renders, etc. I think that adding a wl_surface_commit() call after setting the margin could work.

Adding wl_surface_commit(get_wl_surface()) makes it crash because this->get_window() returns nullptr because the window is "not released". With check if (get_window()) panel shows sometimes.

from wf-shell.

ammen99 avatar ammen99 commented on July 22, 2024

Adding wl_surface_commit(get_wl_surface()) makes it crash because this->get_window() returns nullptr because the window is "not released". With check if (get_window()) panel shows sometimes.

That's a weird error. Perhaps we can store the wl_surface in the constructor and skip the get_window() call?

from wf-shell.

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.