Moved the UsePrimary config parameter to the x11drv section, renamed

as UsePrimarySelection.
This commit is contained in:
Alexandre Julliard 2005-04-21 17:31:50 +00:00
parent 7e181f49a8
commit 333e49d78b
4 changed files with 11 additions and 20 deletions

View File

@ -138,7 +138,6 @@ typedef struct tagWINE_CLIPFORMAT {
static int selectionAcquired = 0; /* Contains the current selection masks */
static Window selectionWindow = None; /* The top level X window which owns the selection */
static BOOL usePrimary = FALSE; /* Use primary selection in additon to the clipboard selection */
static Atom selectionCacheSrc = XA_PRIMARY; /* The selection source from which the clipboard cache was filled */
INT X11DRV_RegisterClipboardFormat(LPCWSTR FormatName);
@ -315,8 +314,6 @@ static UINT ClipDataCount = 0;
*/
static UINT wSeqNo = 0;
#define IS_OPTION_TRUE(ch) ((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1')
/**************************************************************************
* Internal Clipboard implementation methods
**************************************************************************/
@ -347,16 +344,6 @@ static Window thread_selection_wnd(void)
void X11DRV_InitClipboard(void)
{
UINT i;
HKEY hkey;
if(!RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\Clipboard", &hkey))
{
char buffer[20];
DWORD type, count = sizeof(buffer);
if(!RegQueryValueExA(hkey, "UsePrimary", 0, &type, buffer, &count))
usePrimary = IS_OPTION_TRUE( buffer[0] );
RegCloseKey(hkey);
}
/* Register known mapping between window formats and X properties */
for (i = 0; i < sizeof(PropertyFormatMap)/sizeof(PropertyFormatMap[0]); i++)
@ -1652,11 +1639,11 @@ static int X11DRV_CLIPBOARD_QueryAvailableData(LPCLIPBOARDINFO lpcbinfo)
* Query the selection owner for the TARGETS property
*/
wine_tsx11_lock();
if ((usePrimary && XGetSelectionOwner(display,XA_PRIMARY)) ||
if ((use_primary_selection && XGetSelectionOwner(display,XA_PRIMARY)) ||
XGetSelectionOwner(display,x11drv_atom(CLIPBOARD)))
{
wine_tsx11_unlock();
if (usePrimary && (X11DRV_CLIPBOARD_QueryTargets(display, w, XA_PRIMARY, x11drv_atom(TARGETS), &xe)))
if (use_primary_selection && (X11DRV_CLIPBOARD_QueryTargets(display, w, XA_PRIMARY, x11drv_atom(TARGETS), &xe)))
selectionCacheSrc = XA_PRIMARY;
else if (X11DRV_CLIPBOARD_QueryTargets(display, w, x11drv_atom(CLIPBOARD), x11drv_atom(TARGETS), &xe))
selectionCacheSrc = x11drv_atom(CLIPBOARD);
@ -2163,14 +2150,14 @@ void X11DRV_AcquireClipboard(HWND hWndClipWindow)
wine_tsx11_lock();
/* Grab PRIMARY selection if not owned */
if (usePrimary && !(selectionAcquired & S_PRIMARY))
if (use_primary_selection && !(selectionAcquired & S_PRIMARY))
XSetSelectionOwner(display, XA_PRIMARY, owner, CurrentTime);
/* Grab CLIPBOARD selection if not owned */
if (!(selectionAcquired & S_CLIPBOARD))
XSetSelectionOwner(display, x11drv_atom(CLIPBOARD), owner, CurrentTime);
if (usePrimary && XGetSelectionOwner(display,XA_PRIMARY) == owner)
if (use_primary_selection && XGetSelectionOwner(display,XA_PRIMARY) == owner)
selectionAcquired |= S_PRIMARY;
if (XGetSelectionOwner(display,x11drv_atom(CLIPBOARD)) == owner)

View File

@ -536,6 +536,7 @@ extern unsigned int screen_depth;
extern unsigned int text_caps;
extern int use_xkb;
extern int use_take_focus;
extern int use_primary_selection;
extern int managed_mode;
extern BYTE key_state_table[256];

View File

@ -74,6 +74,7 @@ int usexvidmode = 0;
int usexrandr = 1;
int use_xkb = 1;
int use_take_focus = 1;
int use_primary_selection = 0;
int managed_mode = 1;
int client_side_with_core = 1;
int client_side_with_render = 1;
@ -270,6 +271,9 @@ static void setup_options(void)
if (!get_config_key( hkey, appkey, "UseTakeFocus", buffer, sizeof(buffer) ))
use_take_focus = IS_OPTION_TRUE( buffer[0] );
if (!get_config_key( hkey, appkey, "UsePrimarySelection", buffer, sizeof(buffer) ))
use_primary_selection = IS_OPTION_TRUE( buffer[0] );
screen_depth = 0;
if (!get_config_key( hkey, appkey, "ScreenDepth", buffer, sizeof(buffer) ))
screen_depth = atoi(buffer);

View File

@ -66,6 +66,8 @@ WINE REGISTRY Version 2
"UseXRandR" = "Y"
; Use the take focus protocol
"UseTakeFocus" = "Y"
; Use primary selection in addition to clipboard
"UsePrimarySelection" = "N"
; Enable DirectX mouse grab
"DXGrab" = "N"
; Create the desktop window with a double-buffered visual
@ -138,9 +140,6 @@ WINE REGISTRY Version 2
;"SnoopExclude" = "RtlEnterCriticalSection;RtlLeaveCriticalSection"
;"SpyExclude" = "WM_SIZE;WM_TIMER;"
[Clipboard]
"UsePrimary" = "0"
; List of all directories directly contain .AFM files
[afmdirs]
"1" = "/usr/share/ghostscript/fonts"