Good day list!
I've been searching for this for a while: Is there a width and height
limit for xpixmaps? I'm using GTK and I know GDK pixmaps and windows
can't be wider than 65535. And I suspect for X, it's 32767.
I've made a test program to check that and I get the 'BadAlloc' error
every time the program run out of memory ***or when width is > 32767***.
So my question is: Is this ***documented*** somewhere? Because it would
be much better to limit width in my app (or in GTK) so that it doesn't
crash unexpectedly and falsly report that it's running out of memory.
Thanks in advance for any hints.
--
Emmanuel Thomas-Maurin <[email protected]>
#! /bin/bash
gcc -o test test.c `pkg-config --cflags --libs gtk+-2.0`
#! /bin/bash
clear
echo -n "Press any key"
read key
./test 32767 1
echo -n "Press any key"
read key
./test 32767 2
echo -n "Press any key"
read key
./test 32767 4
echo -n "Press any key"
read key
./test 32767 8
echo -n "Press any key"
read key
./test 32768 1
/* try this with width = 32767 then 32768 */
#include <gtk/gtk.h>
int main(int argc, char *argv[])
{
GtkWidget *win;
int width, height;
if (argc != 3)
printf("Usage: test WIDTH HEIGHT\n");
else {
width = atoi(argv[1]);
height = atoi(argv[2]);
printf("Creating window: width = %d / height =%d / surface = %d\n", width, height, width * height);
gtk_init(&argc, &argv);
win = gtk_dialog_new();
gtk_window_set_decorated(GTK_WINDOW(win), FALSE);
gtk_widget_set_size_request(win, width, height);
gtk_widget_show_all(win);
while (gtk_events_pending())
gtk_main_iteration();
printf("Waiting 3 sec\n");
sleep(3);
printf("Ok\n");
gtk_widget_destroy(win);
}
return 0;
}
_______________________________________________
[email protected]: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.freedesktop.org/mailman/listinfo/xorg
Your subscription address: [email protected]