wayfire icon indicating copy to clipboard operation
wayfire copied to clipboard

Prevent Waybar from hiding.

Open AgostinoA opened this issue 10 months ago • 10 comments

Describe the bug
I've been going crazy for days and can't figure out how this issue started. I updated both Wayfire to the latest version and Waybar, and from that moment on, this problem appeared: when I open a fullscreen app, especially with Wine, Waybar leaves an empty space in the bar area and doesn't go fully fullscreen.

I'm not sure if it's an IPC request timing issue or something else. However, if I toggle fullscreen on and off from within the game, it works correctly.

Additionally, in some games like Crysis 2, all mouse position events become misaligned, making the cursor behave erratically.

To Reproduce

  1. Open a game in fullscreen.

Expected behavior
I expect that any app running in fullscreen should cover the entire screen and that mouse input should remain accurate.

Screenshots or stacktrace

Image

Image

Wayfire version
git

AgostinoA avatar Feb 21 '25 18:02 AgostinoA

It might be 78899608 causing the problem. Does the commit before this one work ok?

soreau avatar Feb 21 '25 18:02 soreau

Yes, it did that before that change too.

AgostinoA avatar Feb 21 '25 18:02 AgostinoA

I found a report from another user experiencing the same issue on Waybar:
[Waybar Issue #3387](https://github.com/Alexays/Waybar/issues/3387).
Now, I'm not sure if the issue is caused by Wayfire or Waybar. 😅

AgostinoA avatar Feb 21 '25 18:02 AgostinoA

Maybe check if wf-panel does the same thing.

soreau avatar Feb 21 '25 18:02 soreau

"Waybar leaves an empty space in the bar area and doesn't go fully fullscreen." You want waybar to go full screen?

CarloWood avatar Feb 21 '25 18:02 CarloWood

I want the empty space not to remain

AgostinoA avatar Feb 21 '25 18:02 AgostinoA

Maybe check if wf-panel does the same thing.

Same problem, even with wf-panel. I created a simple fullscreen screen using GLFW.
Check if it happens to you as well, because I can't figure out if it's only on my configurations or something else.
Image

I'm also uploading the code for a test.

#include <GLFW/glfw3.h>

int main() {
    if (!glfwInit()) return -1;

    GLFWmonitor* primaryMonitor = glfwGetPrimaryMonitor();
    const GLFWvidmode* mode = glfwGetVideoMode(primaryMonitor);

    glfwWindowHint(GLFW_RED_BITS, mode->redBits);
    glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits);
    glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits);
    glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate);

    GLFWwindow* window = glfwCreateWindow(mode->width, mode->height, "Fullscreen Red", primaryMonitor, nullptr);
    if (!window) {
        glfwTerminate();
        return -1;
    }

    glfwMakeContextCurrent(window);

    while (!glfwWindowShouldClose(window)) {
        glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
        glClear(GL_COLOR_BUFFER_BIT);
        
        glfwSwapBuffers(window);
        glfwPollEvents();
    }

    glfwDestroyWindow(window);
    glfwTerminate();
    return 0;
}

@ammen99 Can you support me with this? Sorry for the trouble.

AgostinoA avatar Feb 22 '25 08:02 AgostinoA

@CarloWood and @soreau, but do you have this problem?

AgostinoA avatar Feb 24 '25 09:02 AgostinoA

@AgostinoA thanks for your glfw example, I can reproduce the issue. Will look into it and let you know when a bug fix is available.

ammen99 avatar Feb 24 '25 09:02 ammen99

@ammen99 It's a real pleasure for me. I'm here to find as many bugs as possible and give support to the project.

AgostinoA avatar Feb 24 '25 09:02 AgostinoA

I had this issue before, but it's not happening anymore, at least for me. I can't reproduce it if it still exists. I am using: "99e61eb7cd3dc47c5a27efd1ff45f35611e337ba".

killown avatar Jun 22 '25 21:06 killown

Have you tried with a bar like wf-panel or waybar? Because the problem is still evident to me.

AgostinoA avatar Jun 28 '25 14:06 AgostinoA

Have you tried with a bar like wf-panel or waybar? Because the problem is still evident to me.

https://github.com/user-attachments/assets/4ded8b24-f8a9-4128-8f9a-40098778ef0f

killown avatar Jun 28 '25 17:06 killown

Kindly can you share your wayfire.ini configuration? Did you compile using the master branch version or from your commit ?

AgostinoA avatar Jun 28 '25 18:06 AgostinoA

Kindly can you share your wayfire.ini configuration? Did you compile using the master branch version or from your commit ?

If you share your config, I can check whether the issue is in the configuration or not.

killown avatar Jun 28 '25 20:06 killown

Sorry for the trouble, but I still haven’t figured out this issue. I’m sharing my test base Wayfire and Waybar configs, I’m going crazy over this 😅 I don’t understand how you managed to get it working without making any specific code changes. I'm using the latest build compiled today from the repo waybar.ini.txt wayfire.ini.txt

AgostinoA avatar Jul 19 '25 11:07 AgostinoA

@ammen99 Is this problem also evident by you I am doing something wrong in the configuration?

AgostinoA avatar Jul 21 '25 06:07 AgostinoA

I can reproduce this bug in normal usage quite often, though not every time. It is a very weird bug but I'll be looking into it more, this is why I added it to the 0.10 milestone.

ammen99 avatar Jul 21 '25 09:07 ammen99

Ah ok I didn't understand, perfect.

However maybe I understood the problem from where it could arise from the reflow reserved areas method (workarea), it is missing the concept that if a window is in pending fullscreen it must exclude anchors

AgostinoA avatar Jul 21 '25 09:07 AgostinoA

However maybe I understood the problem from where it could arise from the reflow reserved areas method (workarea), it is missing the concept that if a window is in pending fullscreen it must exclude anchors

The method is simply computing the workarea. But the workarea is a 'hint', fullscreen windows simply ignore it and take the full space.

ammen99 avatar Jul 21 '25 09:07 ammen99

If you try, for example, to brutally put if (false) or exclude this piece of code:

if(false)
{
  switch (a->edge)
  {
    case ANCHORED_EDGE_TOP:
      priv->current_workarea.y += a->reserved_size;
  
    // fallthrough
    case ANCHORED_EDGE_BOTTOM:
      priv->current_workarea.height -= a->reserved_size;
      break;
  
    case ANCHORED_EDGE_LEFT:
      priv->current_workarea.x += a->reserved_size;
  
    // fallthrough
    case ANCHORED_EDGE_RIGHT:
      priv->current_workarea.width -= a->reserved_size;
      break;
  }
}

You realize that, for example, the GLFW sample I gave you goes fullscreen correctly. So during opening, it passes through workareareflow_reserved_areas, in this case.

AgostinoA avatar Jul 21 '25 09:07 AgostinoA

I closed by mistake, sorry

AgostinoA avatar Jul 21 '25 09:07 AgostinoA

@AgostinoA Certainly, but what I am explaining is that the workarea calculation does not imply that a fullscreen window will get this size. See for example here: https://github.com/WayfireWM/wayfire/blob/a1d73f58a714ab9bd22ceba4de2aa3c62f9cddf4/src/core/window-manager.cpp#L204-L300

ammen99 avatar Jul 21 '25 09:07 ammen99

By the way, do you get this bug without the grid plugin?

ammen99 avatar Jul 21 '25 09:07 ammen99

I also tried disabling the grid, but it still causes the problem. Does it behave differently for you?

AgostinoA avatar Jul 21 '25 09:07 AgostinoA

it's something from the config, not happening here, if you paste your config or at least give the plugins list, I could compare.

killown avatar Jul 21 '25 10:07 killown

The configuration is in the previous messages, see. Or please send me your minimal configuration where it works for you, because I've been trying a thousand different combinations of plugins and other things for days. Thx for all guys

AgostinoA avatar Jul 21 '25 10:07 AgostinoA

@killown It is also worth mentioning it does not happen every time for me. Sometimes it works, sometimes it does not.

ammen99 avatar Jul 21 '25 10:07 ammen99

https://github.com/user-attachments/assets/d2ccc353-599c-4cff-ab72-6612dbc1301e

killown avatar Jul 21 '25 10:07 killown

Fullscreen must try on X11-based apps, as an example I passed along (GLFW)

AgostinoA avatar Jul 21 '25 11:07 AgostinoA