Skip to content

puglSetSizeHint with PUGL_CURRENT_SIZE doesn't work on X11/KDE #137

@swesterfeld

Description

@swesterfeld

I am on KUbuntu 24.04, using KDE with pugl from main. If I run examples/pugl_window_demo and use Shift+LEFT, Shift+RIGHT, ... nothing happens (this should change the window size). It works if I add a call XSetWMNormalHints to puglSetWindowSize like this:

PuglStatus
puglSetWindowSize(PuglView* const view,
                  const unsigned  width,
                  const unsigned  height)
{
  //- HACK: change size hints before resizing ------------------------------
  XSizeHints *hints = XAllocSizeHints();
  hints->min_width = width;
  hints->min_height = height;
  hints->max_width = width;
  hints->max_height = height;
  hints->flags = PMaxSize | PMinSize;

  XSetWMNormalHints(view->world->impl->display, view->impl->win, hints);
  //------------------------------------------------------------------------

  return puglX11Status(
    XResizeWindow(view->world->impl->display, view->impl->win, width, height));
}

I know that this is probably not the right thing to do, but I'm not sure what is the right thing to do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions