Search code examples
gnomegnome-shell

Missing pixels from upper left of window placed at origin


I have an application that uses a non-decorated window (no title bar and so on, it's eventually intended to be a full-screen application). It also has one-pixel-wide line images around the outside to form a natural border with the outside world.

When I run this application and the Window gets its default position (i.e., not at the (0,0) origin), the borders are clearly visible.

However, when I perform a this.Move(0, 0) in the constructor of the main window to make sure the window is positioned correctly, the upper-right pixels seem to disappear thus:

enter image description here

Ignore the Act text in that capture, it's actually the Activities menu under Gnome desktop. The actual upper-left pixel of the window is where those two red lines would meet.

Does anyone know what could be causing this issue? Is it possibly something to do with the Gnome Shell extensions taking control of that area?


Solution

  • The missing pixels are an artifact of the way gnome-shell does rounded rectangles for its windows.

    If you really want to change it, you can edit the file /usr/share/gnome-shell/theme/gnome-shell.css. Look for the CSS selector .panel-corner and set -panel-corner-radius to 0px. This will cause the windows to have square corners rather than rounded ones. You will probably need to restart gnome-shell after making the change by pressing Alt-F2 and enter the r command.

    Whether that edit will survive a gnome-shell (or even a theme) update is unsure, you may have to put into place something that keeps it at the value you want (or install an extension to do that for you).