We only set changes on the main protocol screen as, for example
in RRSetChanged() and RRTellChanged(), therefore we should follow
the same logic when reporting that an output changed in
RROutputChanged().
This means that RRTellChanged() will then update the relevant
timestamps also when events come from gpu screens.
[ajax: Fix mixed code and decls]
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
FatalError ends up calling xf86CloseConsole itself, so calling FatalError
from within xf86CloseConsole is not a good idea.
Make switch_to log errors using xf86Msg(X_WARNING, ...) and return success
(or failure).
This makes switch_to match the other error checking done in xf86CloseConsole
which all logs warnings and continues.
Add checking of the return value in xf86OpenConsole and call
FatalError there when switch_to fails, to preserve the error-handling
behavior of xf86OpenConsole.
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1269210
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
xichangehierarchy.c:424:23: warning: comparison of constant 536870911 with expression of type 'uint16_t'
(aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare,Semantic Issue]
if (stuff->length > (INT_MAX >> 2))
~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
xichangehierarchy.c:438:26: warning: comparison of constant 536870911 with expression of type 'uint16_t'
(aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare,Semantic Issue]
if ((any->length > (INT_MAX >> 2)) || (len < (any->length << 2)))
~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
hurd does not have any PATH_MAX limitation. misc.h provides a default value
which is fine here.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Patch 3ab6cd31cb fixed Xinerama
interactions with font servers by not putting clients to sleep
multiple times. However, it introduced additional changes dealing with
libXfont routine returning Suspended more than once for the same
request. This additional change was to abandon processing of the
current request and free the closure data by jumping to
'xinerama_sleep' in each of the functions.
Font library functions shouldn't return Suspended more than once,
except for ListFontsWithInfo, which produces multiple replies, and
thus ends up returning Suspended many times during processing.
With the jump to xinerama_sleep occurring after the first reply was
processed, the closure for the request was freed and future calls into
the ListFontsWithInfo callback resulted in dereferencing freed
memory.
This patch removes the added branches, reverting the code to its
previous behaviour, which permitted multiple Suspended returns and
simply waited for the client to be signaled again so that the callback
could continue processing the request.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
When the server is privileged, we shouldn't be passing the user's
environment directly.
Clearing the environment is recommended by the libdbus maintainers, see
https://bugs.freedesktop.org/show_bug.cgi?id=52202
v2: rename envp to empty_envp (Jeremy)
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83849
Signed-off-by: Julien Cristau <jcristau@debian.org>
rrtransform.c:199:23: warning: shifting a negative signed value is undefined [-Wshift-negative-value,Semantic Issue]
rot_cos = F(-1);
^~~~~
rrtransform.c:114:14: note: expanded from macro 'F'
^~~~~~~~~~~~~~
../render/picture.h:200:24: note: expanded from macro 'IntToxFixed'
^~~~~~~~~~~~~~~~~~~~~~
/opt/X11/include/pixman-1/pixman.h:130:56: note: expanded from macro 'pixman_int_to_fixed'
~~~ ^
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
xdmcp.c:1404:1: warning: function 'XdmcpFatal' could be declared with attribute 'noreturn'
[-Wmissing-noreturn,Semantic Issue]
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
XID may be either 'unsigned long' or 'unsigned int' depending on:
typedef unsigned long CARD64;
typedef unsigned int CARD32;
typedef unsigned long long CARD64;
typedef unsigned long CARD32;
typedef unsigned long XID;
typedef CARD32 XID;
so when building with -Wformat, we get some warnings that are benign. This silences them.
security.c:215:52: warning: format specifies type 'int' but the argument has type 'XID' (aka 'unsigned long')
[-Wformat,Format String Issue]
SecurityAudit("revoked authorization ID %d\n", pAuth->id);
~~ ^~~~~~~~~
%lu
CC dpmsstubs.lo
security.c:553:25: warning: format specifies type 'int' but the argument has type 'XID' (aka 'unsigned long')
[-Wformat,Format String Issue]
client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
^~~~~~~~~
security.c:553:55: warning: format specifies type 'int' but the argument has type 'CARD32' (aka 'unsigned long')
[-Wformat,Format String Issue]
client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
^~~~~~~~~~~~~~
security.c:554:10: warning: format specifies type 'int' but the argument has type 'XID' (aka 'unsigned long')
[-Wformat,Format String Issue]
pAuth->group, eventMask);
^~~~~~~~~~~~
security.c:554:24: warning: format specifies type 'int' but the argument has type 'Mask' (aka 'unsigned long')
[-Wformat,Format String Issue]
pAuth->group, eventMask);
^~~~~~~~~
security.c:781:19: warning: format specifies type 'unsigned int' but the argument has type 'Mask' (aka 'unsigned
long')
[-Wformat,Format String Issue]
requested, rec->id, cid,
^~~~~~~~~
security.c:781:30: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
[-Wformat,Format String Issue]
requested, rec->id, cid,
^~~~~~~
security.c:863:23: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
[-Wformat,Format String Issue]
rec->pWin->drawable.id, wClient(rec->pWin)->index,
^~~~~~~~~~~~~~~~~~~~~~
security.c:893:31: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
[-Wformat,Format String Issue]
rec->pWin->drawable.id,
^~~~~~~~~~~~~~~~~~~~~~
security.c:915:39: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
[-Wformat,Format String Issue]
rec->client->index, rec->pWin->drawable.id,
^~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
xdmauth.c:230:13: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of
type
'int'
which may cause truncation of value [-Wabsolute-value,Semantic Issue]
if (abs(now - client->time) > TwentyFiveMinutes) {
^
xdmauth.c:230:13: note: use function 'labs' instead [Semantic Issue]
if (abs(now - client->time) > TwentyFiveMinutes) {
^~~
labs
xdmauth.c:302:9: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type
'int' which
may cause truncation of value [-Wabsolute-value,Semantic Issue]
if (abs(client->time - now) > TwentyMinutes) {
^
xdmauth.c:302:9: note: use function 'labs' instead [Semantic Issue]
if (abs(client->time - now) > TwentyMinutes) {
^~~
labs
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
rrtransform.c:124:22: warning: using integer absolute value function 'abs' when
argument is of floating point type [-Wabsolute-value,Semantic Issue]
if ((v = abs(f_transform->m[j][i])) > max)
^
rrtransform.c:124:22: note: use function 'fabs' instead [Semantic Issue]
if ((v = abs(f_transform->m[j][i])) > max)
^~~
fabs
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
miarc.c:1714:9: warning: using integer absolute value function
'abs' when
argument is of floating point type [-Wabsolute-value,Semantic Issue]
if (abs(parc->angle2) >= 360.0)
^
miarc.c:1714:9: note: use function 'fabs' instead [Semantic Issue]
if (abs(parc->angle2) >= 360.0)
^~~
fabs
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+[NSScreen mainScreen] does not mean the primary display. It used to mean the
one with the key window. When "Displays have separate spaces" is enabled, it
means the active screen, the one whose menu bar is mostly opaque. As such, it
may not be the screen whose lower-left corner is located at (0, 0). That's
why its max-Y is not necessarily comparable to its height. That only works
for the primary display.
This code could use [[NSScreen screens] firstObject]. This is always the
primary display, the one whose lower-left corner is at (0, 0).
Once that's done, the above change should be reverted. The height of the
visible frame would be the full height of the screen minus the menu bar _and
the Dock_ if the Dock is along the bottom of the screen.
Actually, there's a theoretically-simpler approach: use
-[NSMenu menuBarHeight]. That replaces a long-deprecated method
+[NSMenuView menuBarHeight]. However, there was a bug in Tiger that led to
the former not working while the latter still worked. I haven't actually
checked recently.
CrossOver's still-kicking X server code uses this code, which tries all of
the above:
NSScreen* primaryScreen = [[NSScreen screens] objectAtIndex:0];
aquaMenuBarHeight = [[NSApp mainMenu] menuBarHeight];
if (!aquaMenuBarHeight) aquaMenuBarHeight = [NSMenuView menuBarHeight];
if (!aquaMenuBarHeight) aquaMenuBarHeight =
NSHeight([primaryScreen frame]) - NSMaxY([primaryScreen visibleFrame]);
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
When we have a single output, just set it to the physical size of that
output. Otherwise try to approximate it calculating a mean m.m. per
dot. Last fallback is to default to 96 DPI.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
When a new output is hot-plugged we need to not only update our internal
screen dimensions, but also the dix screen dimensions, screenInfo
dimensions and the root window dimensions.
https://bugs.freedesktop.org/show_bug.cgi?id=92273
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
All the callers were already checking for failure, except that
createSourcePicture() itself was failing to check whether it
successfully allocated the Picture.
[ajax: Rebase, fix line wrap of preceding line]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
There's nothing in configure to enable this, and KdTsPhyScreen isn't
defined anywhere.
[ajax: Rebase, also clean up Xfbdev]
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Otherwise we stash an uninitalized value, and later use it to compute
the msc_offset for the window. Also initialize ust and crtc_msc so we
never use uninitalized values when present_get_ust_msc fails.
This fixes clients getting stuck waiting indefinitely for an idle
event when a CRTC is turned off.
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
While we have keyboard focus, the server's xkb code is already locking
and latching modifiers appropriately while processing keyboard
events.
Since there is no guaranteed order between wl_keyboard key and
modifiers events, if we got the modifiers event with a locked or
latched modifier and then process the key press event for that
modifier we would wrongly unlock/unlatch. To prevent this, we ignore
locked and latched modifiers while any of our surfaces has keyboard
focus.
But we always need to set the xkb group index since this might be
triggered programatically by the wayland compositor at any time.
Reviewed-by: Daniel Stone <daniels@collabora.com>
With this change, when a key mapped to an action to emulate mouse button
presses and releases is held down, other keys pressed during that time are
still processed normally. This is a prerequisite for proper support of
ISOLock.
Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
The autorepeat for these actions was not correctly implemented, as the key
repeat would be mistakenly interpreted as key releases. Rather than fixing
this, this change simply disables autorepeat for Set/Lock actions, for two
reasons:
- Autorepeating Set/Lock keys make complicate the interactions of actions.
- Autorepeating Set/Lock keys have no apparent benefit, but hurt in the real
world for layouts such as de(neo): Neo has a Level5 shift on the LSGT key,
and a Level5 lock on Level5 of the same key. This is unusable if LSGT
autorepeats. However, disabling autorepeat for key LSGT completely is not
ideal for users that have a "usual" layout besides Neo, where LSGT carries
symbols.
Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Set a destructor function on pixman images and call fbFinishAccess()
from there, rather than directly from free_pixman_pict(). This ensures
that fbFinishAccess() gets called even if pixman still has a reference
to the image after free_pixman_pict(), as is the case for alphamaps.
[ajax: Squash an unused variable warning in the non-wfb build]
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Arcady Goldmints-Orlov <arcadyg@nvidia.com>
Reviewed-by: Søren Sandmann <ssp@redhat.com>
Otherwise we'll fail and/or crash as no context is bound.
Fixes: 64e6124f27 (glamor: move GL_OES_EGL_image check next to EGL_EXT_image_dma_buf_import)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92105
Cc: Michel Dänzer <michel@daenzer.net>
Cc: Nick Sarnie <commendsarnex@gmail.com>
Reported-by: Nick Sarnie <commendsarnex@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Nick Sarnie <commendsarnex@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
output.done event can be sent even on some property change, not only
when announcing the output. Therefore we must check if we already have it
otherwise we may corrupt the list by adding it multiple times.
This fixes bug when xwayland looped indefinitely in output.done handler
and that can be reproduced following these steps (under X without
multi-monitor setup):
1) run weston --output-count=2
2) run xterm, move it so that half is on one output
and half on the other
3) close second output, try run weston-terminal
weston sends updated outputs which trigger this bug.
v2. factor out common code into function
move expecting_events into right branch
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
This makes Xwayland correctly handle a monitor getting unplugged.
[Marek]: use xorg_list_for_each_entry_safe
Signed-off-by: Dima Ryazanov <dima@gmail.com>
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Check for integer overflow before using stuff->count in a multiplication,
to avoid compiler optimizing out due to undefined behaviour, but only
after we've checked to make sure stuff->count is in the range of the
request we're parsing.
Reported-by: jes@posteo.de
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
These extensions were accessing internal OS functions and
structures. Expose the necessary functionality to them and remove
their use of osdep.h
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>