Revert "xkb: write the _XKB_RF_RULES_PROP to each device."
This commit shouldn't have been pushed, we're still sorting out the API we
want to use.
This reverts commit 876910a951.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
			
			
This commit is contained in:
		
							parent
							
								
									00bc043fa0
								
							
						
					
					
						commit
						9c5b761c8c
					
				| 
						 | 
					@ -51,7 +51,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 | 
				
			||||||
#include <X11/extensions/XKMformat.h>
 | 
					#include <X11/extensions/XKMformat.h>
 | 
				
			||||||
#include "xkbfile.h"
 | 
					#include "xkbfile.h"
 | 
				
			||||||
#include "xkb.h"
 | 
					#include "xkb.h"
 | 
				
			||||||
#include "exevents.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define	CREATE_ATOM(s)	MakeAtom(s,sizeof(s)-1,1)
 | 
					#define	CREATE_ATOM(s)	MakeAtom(s,sizeof(s)-1,1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -155,22 +154,18 @@ XkbFreeRMLVOSet(XkbRMLVOSet *rmlvo, Bool freeRMLVO)
 | 
				
			||||||
        memset(rmlvo, 0, sizeof(XkbRMLVOSet));
 | 
					        memset(rmlvo, 0, sizeof(XkbRMLVOSet));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					 | 
				
			||||||
 * Write the given used rules to the device, or (if device is NULL) to the
 | 
					 | 
				
			||||||
 * root window property.
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
static Bool
 | 
					static Bool
 | 
				
			||||||
XkbWriteRulesProp(DeviceIntPtr dev, XkbRMLVOSet *rmlvo)
 | 
					XkbWriteRulesProp(ClientPtr client, pointer closure)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
int 			len,out;
 | 
					int 			len,out;
 | 
				
			||||||
Atom			name;
 | 
					Atom			name;
 | 
				
			||||||
char *			pval;
 | 
					char *			pval;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    len= (rmlvo->rules ? strlen(rmlvo->rules) : 0);
 | 
					    len= (XkbRulesUsed?strlen(XkbRulesUsed):0);
 | 
				
			||||||
    len+= (rmlvo->model ? strlen(rmlvo->model) : 0);
 | 
					    len+= (XkbModelUsed?strlen(XkbModelUsed):0);
 | 
				
			||||||
    len+= (rmlvo->layout ? strlen(rmlvo->layout) : 0);
 | 
					    len+= (XkbLayoutUsed?strlen(XkbLayoutUsed):0);
 | 
				
			||||||
    len+= (rmlvo->variant ? strlen(rmlvo->variant) : 0);
 | 
					    len+= (XkbVariantUsed?strlen(XkbVariantUsed):0);
 | 
				
			||||||
    len+= (rmlvo->options ? strlen(rmlvo->options) : 0);
 | 
					    len+= (XkbOptionsUsed?strlen(XkbOptionsUsed):0);
 | 
				
			||||||
    if (len<1)
 | 
					    if (len<1)
 | 
				
			||||||
	return True;
 | 
						return True;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -188,57 +183,41 @@ char *			pval;
 | 
				
			||||||
	return True;
 | 
						return True;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    out= 0;
 | 
					    out= 0;
 | 
				
			||||||
    if (rmlvo->rules) {
 | 
					    if (XkbRulesUsed) {
 | 
				
			||||||
	strcpy(&pval[out],rmlvo->rules);
 | 
						strcpy(&pval[out],XkbRulesUsed);
 | 
				
			||||||
	out+= strlen(rmlvo->rules);
 | 
						out+= strlen(XkbRulesUsed);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    pval[out++]= '\0';
 | 
					    pval[out++]= '\0';
 | 
				
			||||||
    if (rmlvo->model) {
 | 
					    if (XkbModelUsed) {
 | 
				
			||||||
	strcpy(&pval[out],rmlvo->model);
 | 
						strcpy(&pval[out],XkbModelUsed);
 | 
				
			||||||
	out+= strlen(rmlvo->model);
 | 
						out+= strlen(XkbModelUsed);
 | 
				
			||||||
    } 
 | 
					    } 
 | 
				
			||||||
    pval[out++]= '\0';
 | 
					    pval[out++]= '\0';
 | 
				
			||||||
    if (rmlvo->layout) {
 | 
					    if (XkbLayoutUsed) {
 | 
				
			||||||
	strcpy(&pval[out],rmlvo->layout);
 | 
						strcpy(&pval[out],XkbLayoutUsed);
 | 
				
			||||||
	out+= strlen(rmlvo->layout);
 | 
						out+= strlen(XkbLayoutUsed);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    pval[out++]= '\0';
 | 
					    pval[out++]= '\0';
 | 
				
			||||||
    if (rmlvo->variant) {
 | 
					    if (XkbVariantUsed) {
 | 
				
			||||||
	strcpy(&pval[out],rmlvo->variant);
 | 
						strcpy(&pval[out],XkbVariantUsed);
 | 
				
			||||||
	out+= strlen(rmlvo->variant);
 | 
						out+= strlen(XkbVariantUsed);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    pval[out++]= '\0';
 | 
					    pval[out++]= '\0';
 | 
				
			||||||
    if (rmlvo->options) {
 | 
					    if (XkbOptionsUsed) {
 | 
				
			||||||
	strcpy(&pval[out],rmlvo->options);
 | 
						strcpy(&pval[out],XkbOptionsUsed);
 | 
				
			||||||
	out+= strlen(rmlvo->options);
 | 
						out+= strlen(XkbOptionsUsed);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    pval[out++]= '\0';
 | 
					    pval[out++]= '\0';
 | 
				
			||||||
    if (out!=len) {
 | 
					    if (out!=len) {
 | 
				
			||||||
	ErrorF("[xkb] Internal Error! bad size (%d!=%d) for _XKB_RULES_NAMES\n",
 | 
						ErrorF("[xkb] Internal Error! bad size (%d!=%d) for _XKB_RULES_NAMES\n",
 | 
				
			||||||
								out,len);
 | 
													out,len);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (dev)
 | 
					 | 
				
			||||||
        XIChangeDeviceProperty(dev, name, XA_STRING, 8, PropModeReplace, len,
 | 
					 | 
				
			||||||
                               pval, True);
 | 
					 | 
				
			||||||
    else
 | 
					 | 
				
			||||||
    dixChangeWindowProperty(serverClient, WindowTable[0], name, XA_STRING, 8,
 | 
					    dixChangeWindowProperty(serverClient, WindowTable[0], name, XA_STRING, 8,
 | 
				
			||||||
			    PropModeReplace, len, pval, True);
 | 
								    PropModeReplace, len, pval, True);
 | 
				
			||||||
 | 
					 | 
				
			||||||
    xfree(pval);
 | 
					    xfree(pval);
 | 
				
			||||||
    return True;
 | 
					    return True;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static Bool
 | 
					 | 
				
			||||||
XkbWriteRootWindowRulesProp(ClientPtr client, pointer closure)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    Bool rc;
 | 
					 | 
				
			||||||
    XkbRMLVOSet *rmlvo = (XkbRMLVOSet*)closure;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    rc = XkbWriteRulesProp(NULL, rmlvo);
 | 
					 | 
				
			||||||
    XkbFreeRMLVOSet(rmlvo, TRUE);
 | 
					 | 
				
			||||||
    return rc;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
XkbSetRulesUsed(XkbRMLVOSet *rmlvo)
 | 
					XkbSetRulesUsed(XkbRMLVOSet *rmlvo)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -258,18 +237,7 @@ XkbSetRulesUsed(XkbRMLVOSet *rmlvo)
 | 
				
			||||||
	_XkbFree(XkbOptionsUsed);
 | 
						_XkbFree(XkbOptionsUsed);
 | 
				
			||||||
    XkbOptionsUsed= (rmlvo->options?_XkbDupString(rmlvo->options):NULL);
 | 
					    XkbOptionsUsed= (rmlvo->options?_XkbDupString(rmlvo->options):NULL);
 | 
				
			||||||
    if (XkbWantRulesProp)
 | 
					    if (XkbWantRulesProp)
 | 
				
			||||||
    {
 | 
						QueueWorkProc(XkbWriteRulesProp,NULL,NULL);
 | 
				
			||||||
        XkbRMLVOSet* rmlvo_used = xcalloc(1, sizeof(XkbRMLVOSet));
 | 
					 | 
				
			||||||
        if (rmlvo_used)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            rmlvo_used->rules = _XkbDupString(XkbRulesUsed);
 | 
					 | 
				
			||||||
            rmlvo_used->model = _XkbDupString(XkbModelUsed);
 | 
					 | 
				
			||||||
            rmlvo_used->layout = _XkbDupString(XkbLayoutUsed);
 | 
					 | 
				
			||||||
            rmlvo_used->variant = _XkbDupString(XkbVariantUsed);
 | 
					 | 
				
			||||||
            rmlvo_used->options = _XkbDupString(XkbOptionsUsed);
 | 
					 | 
				
			||||||
            QueueWorkProc(XkbWriteRootWindowRulesProp,NULL,rmlvo_used);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -646,7 +614,6 @@ InitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet *rmlvo,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    XkbSetRulesDflts(rmlvo);
 | 
					    XkbSetRulesDflts(rmlvo);
 | 
				
			||||||
    XkbSetRulesUsed(rmlvo);
 | 
					    XkbSetRulesUsed(rmlvo);
 | 
				
			||||||
    XkbWriteRulesProp(dev, rmlvo);
 | 
					 | 
				
			||||||
    XkbFreeRMLVOSet(&rmlvo_dflts, FALSE);
 | 
					    XkbFreeRMLVOSet(&rmlvo_dflts, FALSE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue