andlabs / andlabs/libui

GTK: onContentSizeChanged handler invoking uiWindowSetContentSize has no effect

Abierto
#234 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C
Estrellas
10.9k
Forks
612
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I expect this to stop the window being resized:

```
/**
gcc -I/usr/include bug.c -lui -o bug
**/
#include
#include

uiWindow *win;

int test_is_closing(uiWindow *w, void *d) {
uiControlDestroy(uiControl(w));
uiQuit();

return 0;
}

void test_has_changed(uiWindow *window, void *arg) {
uiWindowSetContentSize(window, 640, 480);
}

int main(int argc, char **argv) {
const char *initError;
uiInitOptions options;

initError = uiInit(&options);

if (initError) {
return 1;
}

win = uiNewWindow("Title", 640, 480, 0);

uiWindowOnClosing(win, test_is_closing, win);
uiWindowOnContentSizeChanged(win, test_has_changed, win);

uiControlShow(uiControl(win));

uiMain();

uiUninit();

return 0;
}
```

Works on OSX; well enough anyway, user initiated resize results in moving the window.

Messy on windows; You can see frame of window being resized;

Doesn't work at all on GTK, the window is resized (as if the handler were not installed).

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.