Repository: electron
Issue: [Bug]: Windowing Issues in Electron and Chromium
Labels: platform/linux,bug :beetle:,component/BrowserWindow,stale,29-x-y

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.

### Electron Version

29.1.5

### What operating system are you using?

Other Linux

### Operating System Version

Fedora Linux 39 (Workstation Edition) 

### What arch are you using?

x64

### Last Known Working Electron version

_No response_

### Expected Behavior

Windows display, maximize, split tile, and move without graphical glitches and inconsistences

### Actual Behavior

I know this is not how actual behavior should be used, but I am submitting this on my own time. If the layout is too messy, disregard or remove this report.

Please see additional information for my notes, along with attached screenshots, on the windowing behavior. I include notes on Chromium too because some of this will need to be fixed upstream, and I hope to send this there, but I can't quite tell what is peculiar to electron vs chromium.

### Testcase Gist URL

_No response_

### Additional Information

Chromium and Electron
Both Have Chromium version 122.0.6261.0
Electron ver Electron v29.1.5

No scaling
Maximized/Splitscreen to Splitscreen: Electron has a single-pixel gap above and to left of title bar (screenshot 1) and some bugginess (screenshot 2)
	
![Screenshot from 2024-03-24 15-38-40](https://github.com/electron/electron/assets/37001137/24229b65-b438-44b3-9f40-6556059f47e6)
![Screenshot from 2024-03-24 15-44-25](https://github.com/electron/electron/assets/37001137/9d85defb-beaf-4560-a612-bc12960d5394)


Non-maximized to Splitscreen: Electron breaks, expanding right (both right and left tile expand right), graphical errors very slight on top bar (expands past windows, can see behind top of title bar, barely) (see screenshot)

![Screenshot from 2024-03-24 15-38-40](https://github.com/electron/electron/assets/37001137/c59390b6-bc9c-44e8-be62-e226c452cca4)



Large text (125% text scaling)
Splitscreen chromium shows main window extending slightly right beyond the title bar (screenshot)
![Screenshot from 2024-03-24 15-47-02](https://github.com/electron/electron/assets/37001137/d9f479b0-3098-4841-84ea-7b3753c23114)

Electron unaffected (**DOES NOT SCALE TEXT** which violates accessibility)


Fractional Scaling (125%)

Electron - Scrollbar extends slightly out of window (screenshot) (only tested in windowed electron, might have seen in chromium)
![Screenshot from 2024-03-24 15-50-43](https://github.com/electron/electron/assets/37001137/809d0238-224f-4c4d-8e08-e841dee06119)

Chromium - Title bar enlarges, shadowing sometimes expands on left and right further than main content, when tiled either left or right (Screenshots)
![Screenshot from 2024-03-24 15-53-45](https://github.com/electron/electron/assets/37001137/c82fdc8d-3712-4519-8fd3-d8ab45457aef)
![Screenshot from 2024-03-24 15-55-18](https://github.com/electron/electron/assets/37001137/dcf0689d-3c1f-4d59-86e4-0f81f2aee6e4)

Electron - **Intense** graphical glitching around titlebar in full and splitscreen; titlebar width less than window content (couldn't easily capture in screenshot, as they resolved whenever I tried. Schrodinger's window, I guess)

Electron - Single-pixel gap above and to the left persists when maximized or splitscreened (screenshot); it is more appearant when scaled
![Screenshot from 2024-03-24 15-55-18](https://github.com/electron/electron/assets/37001137/0ff49cb8-a0f6-4d51-93ac-04248b0f2bc2)
![Screenshot from 2024-03-24 15-56-51](https://github.com/electron/electron/assets/37001137/c78fca91-587c-4a0d-bf78-1eccf678549f)


Electron and Chromium - When windowed, shadows/boundaries drawn slightly outside of window content (screenshot)
![Screenshot from 2024-03-24 15-58-35](https://github.com/electron/electron/assets/37001137/5a7fd892-a9ff-4c3f-ba16-bc6cc978e51e)

Electron: Non-maximized to splitscreen behavior persists

Fedora KDE: Doesn't seem to have the same issues by default, but I will note this might be a problem with chromium's gtk implementaiton, instead of GNOME's mutter implementation, as it shows similar issues if switched from chrome://settings/appearance to "Use GTK" and "Use QT" doesn't work at all, but can "Use system title bar and borders" by right clicking the top of the window.
There is what might be a font rendering/spacing issue when fractional scaling.

I omitted testing an integer scale (i.e. 200%). I apologize; I am pretty busy.