mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-18 00:54:19 +00:00
Linux: Fixed some crashes when getting X properties in LinuxComponentPeer
This commit is contained in:
parent
a92b231677
commit
1ea463f989
1 changed files with 14 additions and 8 deletions
|
|
@ -1299,14 +1299,16 @@ public:
|
|||
ScopedXLock xlock (display);
|
||||
GetXProperty prop (display, windowH, atoms->state, 0, 64, false, atoms->state);
|
||||
|
||||
unsigned long state;
|
||||
memcpy (&state, prop.data, sizeof (unsigned long));
|
||||
if (prop.success && prop.actualType == atoms->state
|
||||
&& prop.actualFormat == 32 && prop.numItems > 0)
|
||||
{
|
||||
unsigned long state;
|
||||
memcpy (&state, prop.data, sizeof (unsigned long));
|
||||
|
||||
return prop.success
|
||||
&& prop.actualType == atoms->state
|
||||
&& prop.actualFormat == 32
|
||||
&& prop.numItems > 0
|
||||
&& state == IconicState;
|
||||
return state == IconicState;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void setFullScreen (bool shouldBeFullScreen) override
|
||||
|
|
@ -2757,10 +2759,14 @@ private:
|
|||
long getUserTime() const
|
||||
{
|
||||
GetXProperty prop (display, windowH, atoms->userTime, 0, 65536, false, XA_CARDINAL);
|
||||
|
||||
if (! prop.success)
|
||||
return 0;
|
||||
|
||||
long result;
|
||||
memcpy (&result, prop.data, sizeof (long));
|
||||
|
||||
return prop.success ? result : 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
void updateBorderSize()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue