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

libagar menu and dialog positioned incorrectly in i3wm #90

Open
capocasa opened this issue Nov 23, 2024 · 1 comment
Open

libagar menu and dialog positioned incorrectly in i3wm #90

capocasa opened this issue Nov 23, 2024 · 1 comment
Assignees

Comments

@capocasa
Copy link

capocasa commented Nov 23, 2024

First a few words of happy amazement :) I created some Nim bindings for libagar and it works like a charm!!! Love the simple straight forward interface. It's so cool when you only need a very thin layer to use a C library in a high-level language. Now for the issue.

I noticed an edge-case issue, menu and dialog are positioned incorrectly using the i3 tiling window manager with the glx backend. Windows are in the top left and the width is fullscreen.

image

Example program

#include <agar/core.h>
#include <agar/gui.h>

void MyHandlerFn(AG_Event *event)
{
  AG_TextMsg(AG_MSG_INFO, "Hello, %s!", AG_STRING(1));
}

int main(int argc, char *argv)
{
  AG_Window *win;

  AG_InitCore(NULL, 0);
  AG_InitGraphics(0);

  win = AG_WindowNew(0);
  AG_LabelNew(win, 0, "Hello, world!");

  AG_ButtonNewFn(win, 0, "Hello", MyHandlerFn, "%s", "world");
  AG_WindowShow(win);

  AG_EventLoop();

  return (0);
}

I suspect this is because a tiled window might not have the same sort of position information set as a floating window, which might result in libagar passing some kind of default position when creating the window for the dialog.

The example program works fine in OpenBox. I also noticed that the menu and dialog windows do not appear in the wmctrl -l list in i3, while they do appear there in OpenBox.

I have been unable so far to figure out where the relevant parts might be in the glx driver and window creation code. Any help much appreciated, and thanks again for making libagar!

@capocasa
Copy link
Author

Opened a discussion on the i3 forum as well. i3/i3#6312

@JulNadeauCA JulNadeauCA self-assigned this Nov 30, 2024
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

No branches or pull requests

2 participants