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

Ensure a window's monitor is defined when placing it. #1101

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

somiaj
Copy link
Collaborator

@somiaj somiaj commented Nov 5, 2024

It is possible that the FvwmWindow monitor is NULL, that can cause a crash when broadcasting the window's configuration to packet modules by referencing a NULL pointer to send the monitor's ID. This now happens with StartsOnPage due to #1076 setting the monitor to NULL initially.

This fix ensures that the monitor is always defined after processing any StartsOnScreen settings, by setting it to the current monitor if it is still NULL. Also ensuring the monitor is defined here simplifies some future checks that were doing the same thing by falling back to the current monitor if it was undefined.

This fixes the crash reported in #1100.

@somiaj somiaj mentioned this pull request Nov 5, 2024
It is possible that the FvwmWindow monitor is NULL, that can cause
a crash when broadcasting the window's configuration to packet modules
by referencing a NULL pointer to send the monitor's ID. This now
happens with StartsOnPage due to #1076 setting the monitor to NULL
initially.

This fix ensures that the monitor is always defined after processing
any StartsOnScreen settings, by setting it to the current monitor if
it is still NULL. Also ensuring the monitor is defined here simplifies
some future checks that were doing the same thing by falling back to
the current monitor if it was undefined.

This fixes the crash reported in #1100.
@somiaj somiaj force-pushed the js/placement-ensure-monitor-is-defined branch from 5e03c90 to d9584f0 Compare November 6, 2024 00:37
@ThomasAdam ThomasAdam self-assigned this Nov 7, 2024
@ThomasAdam ThomasAdam added the relates:placement Issue is in window placement code label Nov 7, 2024
@ThomasAdam ThomasAdam added this to the 1.1.1 milestone Nov 7, 2024
@ThomasAdam ThomasAdam merged commit e514f01 into main Nov 7, 2024
12 checks passed
@ThomasAdam ThomasAdam deleted the js/placement-ensure-monitor-is-defined branch November 7, 2024 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relates:placement Issue is in window placement code
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants