tags:

views:

76

answers:

2

Hi!

I've got a C/C++ app using the GLFW Library on a netbook-like device running Ubuntu 8.10.

As far as I understand the source the GLFW lib, it creates its window using calls to the X-Window library.

We do not use any desktop on the machine but login to a tty and start a X-server in the background. When running the compiled application from a tty* on the target platform during the call to

glfwOpenWindow( ... );
  glXQueryExtension( ...);
    _glfwChooseVisual( ... );
       XGetVisualInfo( ... );

the application halts. It does NOT crash. When switching to the X-Window by hitting Ctrl+Alt+F7 the application continues normally.

What could cause this weird behaviour?

BEGIN_EDIT:

Now I am quite sure the problem is related to the configuration of either Ubuntu or the x-server. When I try to run

glxinfo

in the shell the command also hangs until I switch to the X-window by hitting CTRL+ALT+F7. When I return to my shell after hitting the keys the command has finished.

Could it be that the X-server is put to 'sleep' when in console mode?

END_EDIT;

A: 

If the X window server runs in the background, it (obviously) doesn't own the display. Thus it can't reply to requests until its back in the foreground.

That would be my expectation at least. You can't ask a display server to open a window, if that display server is not actually owning the display hardware at the time of the request.

Blocking until it gets control of the hardware back sounds totally sensible to me.

unwind
A: 

Is a login manager running on the X server? They typically will grab the X server for exclusive use. Try logging in and see if that makes a difference.

Nathan Kidd