Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window content sometimes not centered in Gnome Wayland session #2709

Open
Rakksor opened this issue Sep 25, 2023 · 1 comment
Open

Window content sometimes not centered in Gnome Wayland session #2709

Rakksor opened this issue Sep 25, 2023 · 1 comment

Comments

@Rakksor
Copy link

Rakksor commented Sep 25, 2023

Subject of the issue

When opening a fullscreen window with SFML in a Gnome Wayland session the window content is sometimes offset by what seems to be the height of the Gnome top bar. Maybe this is related to #1613?

Your environment

  • Arch Linux, Gnome 44.5
  • SFML 2.6.0
  • g++ 13.2.1

Steps to reproduce

Run this minimal example in a Gnome Wayland session until the issue appears (might take some tries, maybe appears more often when starting while a Firefox window is visible):

#include "SFML/Graphics.hpp"

int main() {
	sf::RenderWindow Window(sf::VideoMode::getDesktopMode(), "Test", sf::Style::Fullscreen);
	sf::Event Event;

	while (Window.isOpen()) {
		while (Window.pollEvent(Event)) {
			if (Event.type == sf::Event::Closed)
				Window.close();
		}
				
		Window.clear(sf::Color(255, 0, 0, 255));
		Window.display();
	}
	return 0;
}

Expected behavior

The window content fills the whole screen. In the above example, this means the whole screen is red. This is also what usually happens:

expected_result

Actual behavior

Sometimes the window content is offset by what seems to be the height of the Gnome top bar and cut off by that amount at the bottom. The above example only shows the first part, the red does not start at the top of the screen but is offset by a grey bar:

actual_result

The grey bar is part of the window as seen in the overview:

actual_result_overview

And as a comparison the desktop view showing the top bar:

desktop

@Rakksor Rakksor changed the title Window content not centered in Gnome Wayland session Window content sometimes not centered in Gnome Wayland session Sep 25, 2023
@eXpl0it3r
Copy link
Member

As SFML doesn't natively support Wayland, what is used to translate the X11 calls to Wayland?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants