Skip to content

RenderWindow 'top' and 'left' values don't get updated when window moves #3483

@valverl

Description

@valverl

System Information

  • Ogre Version: 14.4.1
  • Operating System / Platform: Windows 11
  • RenderSystem: OpenGL

Detailled description

RenderWindow::getMetrics() reports stale top and left values after the window has been moved, unless it has also been resized. It seems to come down to ApplicationContextSDL not calling RenderWindow::reposition when processing a window move event. This is the relevant code in ApplicationContextSDL::pollEvents():

        case SDL_WINDOWEVENT:
            if(event.window.event != SDL_WINDOWEVENT_RESIZED)
                continue;

            for(auto & window : mWindows)
            {
                if(event.window.windowID != SDL_GetWindowID(window.native))
                    continue;

                Ogre::RenderWindow* win = window.render;
                win->resize(event.window.data1, event.window.data2);
                windowResized(win);
            }
            break;

It seems like we should be doing something similar for SDL_WINDOWEVENT_MOVED events. I can give that a go if you're happy with me trying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions