[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][xorg-team/lib/libx11][upstream-unstable] 4 commits: XcmsLookupColor: fully initialize XColor structs passed to _XColor_to_XcmsRGB



Title: GitLab

Timo Aaltonen pushed to branch upstream-unstable at X Strike Force / lib / libx11

Commits:

3 changed files:

Changes:

  • configure.ac
    1 1
     
    
    2 2
     # Initialize Autoconf
    
    3 3
     AC_PREREQ([2.60])
    
    4
    -AC_INIT([libX11], [1.6.6],
    
    4
    +AC_INIT([libX11], [1.6.7],
    
    5 5
             [https://gitlab.freedesktop.org/xorg/lib/libx11/issues], [libX11])
    
    6 6
     AC_CONFIG_SRCDIR([Makefile.am])
    
    7 7
     AC_CONFIG_HEADERS([src/config.h include/X11/XlibConf.h])
    

  • src/xcb_io.c
    ... ... @@ -230,7 +230,7 @@ static void widen(uint64_t *wide, unsigned int narrow)
    230 230
      * variable for that thread to process the response and wake us up.
    
    231 231
      */
    
    232 232
     
    
    233
    -static xcb_generic_reply_t *poll_for_event(Display *dpy)
    
    233
    +static xcb_generic_reply_t *poll_for_event(Display *dpy, Bool queued_only)
    
    234 234
     {
    
    235 235
     	/* Make sure the Display's sequence numbers are valid */
    
    236 236
     	require_socket(dpy);
    
    ... ... @@ -238,8 +238,12 @@ static xcb_generic_reply_t *poll_for_event(Display *dpy)
    238 238
     	/* Precondition: This thread can safely get events from XCB. */
    
    239 239
     	assert(dpy->xcb->event_owner == XlibOwnsEventQueue && !dpy->xcb->event_waiter);
    
    240 240
     
    
    241
    -	if(!dpy->xcb->next_event)
    
    242
    -		dpy->xcb->next_event = xcb_poll_for_event(dpy->xcb->connection);
    
    241
    +	if(!dpy->xcb->next_event) {
    
    242
    +		if(queued_only)
    
    243
    +			dpy->xcb->next_event = xcb_poll_for_queued_event(dpy->xcb->connection);
    
    244
    +		else
    
    245
    +			dpy->xcb->next_event = xcb_poll_for_event(dpy->xcb->connection);
    
    246
    +	}
    
    243 247
     
    
    244 248
     	if(dpy->xcb->next_event)
    
    245 249
     	{
    
    ... ... @@ -271,12 +275,21 @@ static xcb_generic_reply_t *poll_for_response(Display *dpy)
    271 275
     	void *response;
    
    272 276
     	xcb_generic_error_t *error;
    
    273 277
     	PendingRequest *req;
    
    274
    -	while(!(response = poll_for_event(dpy)) &&
    
    278
    +	while(!(response = poll_for_event(dpy, False)) &&
    
    275 279
     	      (req = dpy->xcb->pending_requests) &&
    
    276
    -	      !req->reply_waiter &&
    
    277
    -	      xcb_poll_for_reply64(dpy->xcb->connection, req->sequence, &response, &error))
    
    280
    +	      !req->reply_waiter)
    
    278 281
     	{
    
    279
    -		uint64_t request = X_DPY_GET_REQUEST(dpy);
    
    282
    +		uint64_t request;
    
    283
    +
    
    284
    +		if(!xcb_poll_for_reply64(dpy->xcb->connection, req->sequence,
    
    285
    +					 &response, &error)) {
    
    286
    +			/* xcb_poll_for_reply64 may have read events even if
    
    287
    +			 * there is no reply. */
    
    288
    +			response = poll_for_event(dpy, True);
    
    289
    +			break;
    
    290
    +		}
    
    291
    +
    
    292
    +		request = X_DPY_GET_REQUEST(dpy);
    
    280 293
     		if(XLIB_SEQUENCE_COMPARE(req->sequence, >, request))
    
    281 294
     		{
    
    282 295
     			throw_thread_fail_assert("Unknown sequence number "
    
    ... ... @@ -617,7 +630,7 @@ Status _XReply(Display *dpy, xReply *rep, int extra, Bool discard)
    617 630
     			{ /* need braces around ConditionWait */
    
    618 631
     				ConditionWait(dpy, dpy->xcb->event_notify);
    
    619 632
     			}
    
    620
    -			while((event = poll_for_event(dpy)))
    
    633
    +			while((event = poll_for_event(dpy, True)))
    
    621 634
     				handle_response(dpy, event, True);
    
    622 635
     		}
    
    623 636
     
    

  • src/xcms/cmsLkCol.c
    ... ... @@ -76,7 +76,8 @@ XcmsLookupColor (
    76 76
         register int n;
    
    77 77
         xLookupColorReply reply;
    
    78 78
         register xLookupColorReq *req;
    
    79
    -    XColor def, scr;
    
    79
    +    XColor def = {0,};
    
    80
    +    XColor scr = {0,};
    
    80 81
     
    
    81 82
     /*
    
    82 83
      * 0. Check for invalid arguments.
    


  • Reply to: