Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#149 Remember window position

M. Scott Gartner

On my multiple monitor setup I cannot use full-screen mode, and when I try to use Window mode it always tries to place the screen in the same place which a) does not work and b) isn't where I want it. I have to move the window every time I start the application (which is made very difficult because the window size is larger than the monitor it tries to open the application on) If I capture the mouse, I can't ever move the window at all, which I would like to do.

So, the solution is for the program to remember where I put the window last and always open it there rather than assuming it knows where the window should be. That way I can open the application, go through the gyrations of moving the window where I want it, and then close the application. I can then turn on mouse capture and re-open the application and have it come up on the monitor I want it on at the size I want it with mouse capture. At this point I can't really let my son use the program on this computer at all.


  • Drat, it seems we ask SDL (the graphics library) to position Tux Paint in the center of the screen when running in a window (vs fullscreen).

    Unfortunately, that means we override any preference/hint given by the user prior to launching Tux Paint via the SDL_VIDEO_WINDOW_POS environment variable.

    So we'll need to set up either a command-line option to specify the window placement, or figure out an intelligent way to detect whether a preference has been made via that env. var., and if so, don't override it.

  • Fixed in 0.9.22. Set SDL_VIDEO_WINDOW_POS and Tux Paint will honor it. Otherwise, it will center itself by setting that environment variable to "center", as it has been in previous versions.

    Example on Linux:
    $ SDL_VIDEO_WINDOW_POS=0,0 tuxpaint --windowed

    For more on SDL env vars, see: http://sdl.beuc.net/sdl.wiki/SDL_envvars

  • I didn't even know about the SDL environment variable. It seems to me that it will be very hard for non-technical people to set this variable properly, especially in a multi-monitor situation where the monitors are not the same height, or simply don't align evenly (they might have to play with values like -1024,-20 to get it positioned properly). However, grabbing the title of the window and moving it is easy for everyone to do. Is it viciously difficult for the application to remember settings?

    Is this why the settings program is maintained separately from the drawing program? I assumed it was just to keep kids from being able to change the settings, but maybe it's some technical issue with the porting methodology?

  • Good idea about remembering window position. We could add these as a set of options: (a) always center on display (current behavior), (b) just let window manager place it (would be the default behavior if we didn't ask to center), (c) remember last window position, (d) start at specific window position.

    PS - if you're using Linux, you might be able to ask your window manager to always force Tux Paint into a certain position. (In KDE, at least, there are options in titlebar menu button -> Advanced -> Special Window Settings...)

    Reopening, but setting priority low.