Bug 11825 (glutCreateWindow) - Can't move or reshape a window created with glutCreateWindow(const char *)
Summary: Can't move or reshape a window created with glutCreateWindow(const char *)
Status: RESOLVED WORKSFORME
Alias: glutCreateWindow
Product: xorg
Classification: Unclassified
Component: App/compiz (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: David Reveman
QA Contact: Xorg Project Team
URL: http://lists.freedesktop.org/archives...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-02 16:43 UTC by fargoth
Modified: 2009-02-07 01:43 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description fargoth 2007-08-02 16:43:51 UTC
the window created with the function glutCreateWindow() has no decoration, it can't be resized or moved (not even with ALT pressed and a mouse drag).

this bug has been reported last year on the mailing list, but no one replied to it.

heres a link to that post:
http://lists.freedesktop.org/archives/compiz/2006-October/000651.html
Comment 1 Michel Dänzer 2007-08-03 02:00:23 UTC
(In reply to comment #0)
> the window created with the function glutCreateWindow() has no decoration, 

This is the only possible issue in compiz AFAICS.

> it can't be resized or moved (not even with ALT pressed and a mouse drag).

Using the r300 driver as well here, the window does actually move, it's just not visible because the 3D driver doesn't know how to render to redirected windows correctly yet. See bug 1208.
Comment 2 David Reveman 2007-08-03 07:54:27 UTC
Can't reproduce this issue. Tried a couple of demos from the mesa tree (mesa/prog/demos), which all use glutCreateWindow but all of them gets decorated properly and works fine.
Comment 3 fargoth 2007-08-04 00:24:06 UTC
windows created with SDL have the same bug.
Comment 4 fargoth 2007-08-04 00:28:27 UTC
try this for SDL:

int main ( int argc, char** argv )
{
    // initialize SDL video
    if ( SDL_Init( SDL_INIT_VIDEO ) < 0 )
    {
        printf( "Unable to init SDL: %s\n", SDL_GetError() );
        return 1;
    }

    // make sure SDL cleans up before exit
    atexit(SDL_Quit);

    // create a new window
    SDL_Surface* screen = SDL_SetVideoMode(640, 480, 16,
                                           SDL_HWSURFACE|SDL_DOUBLEBUF);
    if ( !screen )
    {
        printf("Unable to set 640x480 video: %s\n", SDL_GetError());
        return 1;
    }
    bool done = false;
    while (!done)
    {
        // message processing loop
        SDL_Event event;
        while (SDL_PollEvent(&event))
        {
            // check for messages
            switch (event.type)
            {
                // exit if the window is closed
            case SDL_QUIT:
                done = true;
                break;

                // check for keypresses
            case SDL_KEYDOWN:
                {
                    // exit if ESCAPE is pressed
                    if (event.key.keysym.sym == SDLK_ESCAPE)
                        done = true;
                    break;
                }
            } // end switch
        } // end of message processing
    } // end main loop
    printf("Exited cleanly\n");
    return 0;
}
Comment 5 fargoth 2007-08-04 00:35:24 UTC
and for GLUT:

#include <GL/glut.h>

/* GLUT callback Handlers */

static void resize(int width, int height)
{
    const float ar = (float) width / (float) height;

    glViewport(0, 0, width, height);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glFrustum(-ar, ar, -1.0, 1.0, 2.0, 100.0);

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity() ;
}

static void display(void)
{
    const double t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
    const double a = t*90.0;

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glColor3d(1,0,0);
    glPushMatrix();
        glTranslated(-2.4,-1.2,-6);
        glRotated(60,1,0,0);
        glRotated(a,0,0,1);
        glutWireSphere(1,6,6);
    glPopMatrix();
    glutSwapBuffers();
}


static void key(unsigned char key, int x, int y)
{
    switch (key)
    {
        case 27 :
        case 'q':
            exit(0);
            break;
    }
}

static void idle(void)
{
    glutPostRedisplay();
}


int main(int argc, char *argv[])
{
    glutInit(&argc, argv);
    glutInitWindowSize(640,480);
    glutInitWindowPosition(10,10);
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);

    glutCreateWindow("GLUT Shapes");

    glutReshapeFunc(resize);
    glutDisplayFunc(display);
    glutKeyboardFunc(key);
    glutIdleFunc(idle);

    glClearColor(1,1,1,1);
    glEnable(GL_CULL_FACE);
    glCullFace(GL_BACK);

    glEnable(GL_DEPTH_TEST);
    glDepthFunc(GL_LESS);
}
Comment 6 fargoth 2007-08-04 00:53:33 UTC
the example in the letter from 
http://lists.freedesktop.org/archives/compiz/2006-October/000651.html

also shows it (and the code is simpler then the previous one i posted):

#include <GL/glut.h>
void DrawScene(void)
{
	glClearColor(0.5, 0.0, 0.0, 0.0);
	glClear(GL_COLOR_BUFFER_BIT);
	glColor3f(0.0, 0.1, 1.0);
	glutSolidTeapot(0.6);
	glFlush();
}
int main(int argc, char *argv[])
{
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
	glutCreateWindow(argv[0]);
	glutDisplayFunc(DrawScene);
	glutMainLoop();
	return 0;
}
Comment 7 fargoth 2007-08-04 06:33:56 UTC
(In reply to comment #2)
> Can't reproduce this issue. Tried a couple of demos from the mesa tree
> (mesa/prog/demos), which all use glutCreateWindow but all of them gets
> decorated properly and works fine.
> 

hmm.. Iv'e compiled gears.c (from the mesa demos) and encountered the same behaviour...
then i thought I'd better try glxgears (as provided with mesa-utils) and it had no decoration too!

i'm running compiz with the following command:
compiz --replace -c emerald

using the restricted drivers which were provided with Ubuntu 7.04 feisty fawn.

I remember that when i first installed compiz glxgears had it's frame and i could move it around...
I wonder what has changed since then...

anyway, if you need more info on my system, just ask. 
Comment 8 fargoth 2007-08-04 06:58:08 UTC
(In reply to comment #7)
> (In reply to comment #2)
> > Can't reproduce this issue. Tried a couple of demos from the mesa tree
> > (mesa/prog/demos), which all use glutCreateWindow but all of them gets
> > decorated properly and works fine.
> > 
> 
> hmm.. Iv'e compiled gears.c (from the mesa demos) and encountered the same
> behaviour...
> then i thought I'd better try glxgears (as provided with mesa-utils) and it had
> no decoration too!
> 
> i'm running compiz with the following command:
> compiz --replace -c emerald
> 
> using the restricted drivers which were provided with Ubuntu 7.04 feisty fawn.
> 
> I remember that when i first installed compiz glxgears had it's frame and i
> could move it around...
> I wonder what has changed since then...
> 
> anyway, if you need more info on my system, just ask. 
> 

tried it on another computer with the latest drivers (fglrx 8.39.4)
running compiz with Xgl

both computers use the package from 
deb http://download.tuxfamily.org/3v1deb feisty eyecandy

both computers show the same behaviour - the window gets created on the most upper left corner with no frame - you can't resize it or move it around...
Comment 9 Danny Baumann 2008-02-26 22:51:05 UTC
(In reply to comment #6)
> the example in the letter from 
> http://lists.freedesktop.org/archives/compiz/2006-October/000651.html
> 
> also shows it (and the code is simpler then the previous one i posted):
> 
> #include <GL/glut.h>
> void DrawScene(void)
> {
>         glClearColor(0.5, 0.0, 0.0, 0.0);
>         glClear(GL_COLOR_BUFFER_BIT);
>         glColor3f(0.0, 0.1, 1.0);
>         glutSolidTeapot(0.6);
>         glFlush();
> }
> int main(int argc, char *argv[])
> {
>         glutInit(&argc, argv);
>         glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
>         glutCreateWindow(argv[0]);
>         glutDisplayFunc(DrawScene);
>         glutMainLoop();
>         return 0;
> }
> 
Works just fine here, as well as the SDL example from comment #4.
Is this still as issue?
Comment 10 Kristian Lyngstøl 2009-02-07 01:43:17 UTC
No feedback, and this works for me. I'm closing this bug because we're moving bug trackers and it seems to be resolved. Please re-open at bugs.opencompositing.org if you are still experiencing this.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.