Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
d09c3289
Commit
d09c3289
authored
Nov 20, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Intern all the atoms we'll need in one step to avoid multiple server
round trips.
parent
f01e7c63
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
136 additions
and
141 deletions
+136
-141
clipboard.c
dlls/x11drv/clipboard.c
+0
-0
desktop.c
dlls/x11drv/desktop.c
+3
-1
event.c
dlls/x11drv/event.c
+24
-25
window.c
dlls/x11drv/window.c
+70
-65
x11drv.h
dlls/x11drv/x11drv.h
+35
-26
x11drv_main.c
dlls/x11drv/x11drv_main.c
+0
-7
xfont.c
graphics/x11drv/xfont.c
+4
-17
No files found.
dlls/x11drv/clipboard.c
View file @
d09c3289
This diff is collapsed.
Click to expand it.
dlls/x11drv/desktop.c
View file @
d09c3289
...
...
@@ -69,6 +69,7 @@ static DWORD CALLBACK desktop_thread( LPVOID driver_data )
MSG
msg
;
HWND
hwnd
;
WND
*
win
;
Atom
atom
=
x11drv_atom
(
WM_DELETE_WINDOW
);
NtCurrentTeb
()
->
driver_data
=
driver_data
;
display
=
thread_display
();
...
...
@@ -82,7 +83,8 @@ static DWORD CALLBACK desktop_thread( LPVOID driver_data )
SetWindowLongW
(
hwnd
,
GWL_WNDPROC
,
(
LONG
)
desktop_winproc
);
wine_tsx11_lock
();
XSetWMProtocols
(
display
,
root_window
,
&
wmDeleteWindow
,
1
);
XChangeProperty
(
display
,
root_window
,
x11drv_atom
(
WM_PROTOCOLS
),
XA_ATOM
,
32
,
PropModeReplace
,
(
char
*
)
&
atom
,
1
);
XMapWindow
(
display
,
root_window
);
wine_tsx11_unlock
();
...
...
dlls/x11drv/event.c
View file @
d09c3289
...
...
@@ -56,12 +56,6 @@ WINE_DECLARE_DEBUG_CHANNEL(clipboard);
/* X context to associate a hwnd to an X window */
extern
XContext
winContext
;
extern
Atom
wmProtocols
;
extern
Atom
wmDeleteWindow
;
extern
Atom
dndProtocol
;
extern
Atom
dndSelection
;
extern
Atom
netwmPing
;
#define DndNotDnd -1
/* OffiX drag&drop */
#define DndUnknown 0
#define DndRawData 1
...
...
@@ -434,7 +428,7 @@ static void handle_wm_protocols_message( HWND hwnd, XClientMessageEvent *event )
if
(
!
protocol
)
return
;
if
(
protocol
==
wmDeleteWindow
)
if
(
protocol
==
x11drv_atom
(
WM_DELETE_WINDOW
)
)
{
/* Ignore the delete window request if the window has been disabled
* and we are in managed mode. This is to disallow applications from
...
...
@@ -442,7 +436,7 @@ static void handle_wm_protocols_message( HWND hwnd, XClientMessageEvent *event )
*/
if
(
IsWindowEnabled
(
hwnd
))
PostMessageW
(
hwnd
,
WM_SYSCOMMAND
,
SC_CLOSE
,
0
);
}
else
if
(
protocol
==
wmTakeFocus
)
else
if
(
protocol
==
x11drv_atom
(
WM_TAKE_FOCUS
)
)
{
Time
event_time
=
(
Time
)
event
->
data
.
l
[
1
];
HWND
last_focus
=
x11drv_thread_data
()
->
last_focus
;
...
...
@@ -469,7 +463,9 @@ static void handle_wm_protocols_message( HWND hwnd, XClientMessageEvent *event )
if
(
!
hwnd
)
hwnd
=
last_focus
;
if
(
hwnd
&&
can_activate_window
(
hwnd
))
set_focus
(
hwnd
,
event_time
);
}
}
else
if
(
protocol
==
netwmPing
)
{
}
else
if
(
protocol
==
x11drv_atom
(
_NET_WM_PING
))
{
XClientMessageEvent
xev
;
xev
=
*
event
;
...
...
@@ -513,7 +509,7 @@ static void EVENT_FocusIn( HWND hwnd, XFocusChangeEvent *event )
XSetICFocus
(
xic
);
wine_tsx11_unlock
();
}
if
(
wmTakeF
ocus
)
return
;
/* ignore FocusIn if we are using take focus */
if
(
use_take_f
ocus
)
return
;
/* ignore FocusIn if we are using take focus */
if
(
!
can_activate_window
(
hwnd
))
{
...
...
@@ -636,7 +632,7 @@ static Atom EVENT_SelectionRequest_TARGETS( Display *display, Window requestor,
return
None
;
/* Create TARGETS property list (First item in list is TARGETS itself) */
for
(
targets
[
0
]
=
x
aTargets
,
cTargets
=
1
,
wFormat
=
0
;
for
(
targets
[
0
]
=
x
11drv_atom
(
TARGETS
)
,
cTargets
=
1
,
wFormat
=
0
;
(
wFormat
=
X11DRV_EnumClipboardFormats
(
wFormat
));)
{
LPWINE_CLIPFORMAT
lpFormat
=
X11DRV_CLIPBOARD_LookupFormat
(
wFormat
);
...
...
@@ -736,14 +732,17 @@ static Atom EVENT_SelectionRequest_MULTIPLE( HWND hWnd, XSelectionRequestEvent *
for
(
i
=
0
;
i
<
cTargetPropList
;
i
+=
2
)
{
char
*
targetName
=
TSXGetAtomName
(
display
,
targetPropList
[
i
]);
char
*
propName
=
TSXGetAtomName
(
display
,
targetPropList
[
i
+
1
]);
XSelectionRequestEvent
event
;
TRACE
(
"MULTIPLE(%d): Target='%s' Prop='%s'
\n
"
,
i
/
2
,
targetName
,
propName
);
TSXFree
(
targetName
);
TSXFree
(
propName
);
if
(
TRACE_ON
(
event
))
{
char
*
targetName
=
TSXGetAtomName
(
display
,
targetPropList
[
i
]);
char
*
propName
=
TSXGetAtomName
(
display
,
targetPropList
[
i
+
1
]);
TRACE
(
"MULTIPLE(%d): Target='%s' Prop='%s'
\n
"
,
i
/
2
,
targetName
,
propName
);
TSXFree
(
targetName
);
TSXFree
(
propName
);
}
/* We must have a non "None" property to service a MULTIPLE target atom */
if
(
!
targetPropList
[
i
+
1
]
)
...
...
@@ -798,7 +797,7 @@ static void EVENT_SelectionRequest( HWND hWnd, XSelectionRequestEvent *event, BO
*/
if
(
!
bIsMultiple
)
{
if
(((
event
->
selection
!=
XA_PRIMARY
)
&&
(
event
->
selection
!=
x
aClipboard
)))
if
(((
event
->
selection
!=
XA_PRIMARY
)
&&
(
event
->
selection
!=
x
11drv_atom
(
CLIPBOARD
)
)))
goto
END
;
}
...
...
@@ -809,12 +808,12 @@ static void EVENT_SelectionRequest( HWND hWnd, XSelectionRequestEvent *event, BO
if
(
rprop
==
None
)
rprop
=
event
->
target
;
if
(
event
->
target
==
x
aTargets
)
/* Return a list of all supported targets */
if
(
event
->
target
==
x
11drv_atom
(
TARGETS
)
)
/* Return a list of all supported targets */
{
/* TARGETS selection request */
rprop
=
EVENT_SelectionRequest_TARGETS
(
display
,
request
,
event
->
target
,
rprop
);
}
else
if
(
event
->
target
==
x
aMultiple
)
/* rprop contains a list of (target, property) atom pairs */
else
if
(
event
->
target
==
x
11drv_atom
(
MULTIPLE
)
)
/* rprop contains a list of (target, property) atom pairs */
{
/* MULTIPLE selection request */
rprop
=
EVENT_SelectionRequest_MULTIPLE
(
hWnd
,
event
);
...
...
@@ -884,7 +883,7 @@ END:
*/
static
void
EVENT_SelectionClear
(
HWND
hWnd
,
XSelectionClearEvent
*
event
)
{
if
(
event
->
selection
==
XA_PRIMARY
||
event
->
selection
==
x
aClipboard
)
if
(
event
->
selection
==
XA_PRIMARY
||
event
->
selection
==
x
11drv_atom
(
CLIPBOARD
)
)
X11DRV_CLIPBOARD_ReleaseSelection
(
event
->
selection
,
event
->
window
,
hWnd
);
}
...
...
@@ -1029,7 +1028,7 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
if
(
!
bAccept
)
return
;
TSXGetWindowProperty
(
event
->
display
,
DefaultRootWindow
(
event
->
display
),
dndSelection
,
0
,
65535
,
FALSE
,
x11drv_atom
(
DndSelection
)
,
0
,
65535
,
FALSE
,
AnyPropertyType
,
&
u
.
atom_aux
,
(
int
*
)
&
u
.
pt_aux
.
y
,
&
data_length
,
&
aux_long
,
&
p_data
);
...
...
@@ -1118,7 +1117,7 @@ static void EVENT_DropURLs( HWND hWnd, XClientMessageEvent *event )
if
(
!
(
GetWindowLongW
(
hWnd
,
GWL_EXSTYLE
)
&
WS_EX_ACCEPTFILES
))
return
;
TSXGetWindowProperty
(
event
->
display
,
DefaultRootWindow
(
event
->
display
),
dndSelection
,
0
,
65535
,
FALSE
,
x11drv_atom
(
DndSelection
)
,
0
,
65535
,
FALSE
,
AnyPropertyType
,
&
u
.
atom_aux
,
&
u
.
i
,
&
data_length
,
&
aux_long
,
&
p_data
);
if
(
aux_long
)
...
...
@@ -1208,9 +1207,9 @@ static void EVENT_DropURLs( HWND hWnd, XClientMessageEvent *event )
static
void
EVENT_ClientMessage
(
HWND
hWnd
,
XClientMessageEvent
*
event
)
{
if
(
event
->
message_type
!=
None
&&
event
->
format
==
32
)
{
if
(
event
->
message_type
==
wmProtocols
)
if
(
event
->
message_type
==
x11drv_atom
(
WM_PROTOCOLS
)
)
handle_wm_protocols_message
(
hWnd
,
event
);
else
if
(
event
->
message_type
==
dndProtocol
)
else
if
(
event
->
message_type
==
x11drv_atom
(
DndProtocol
)
)
{
/* query window (drag&drop event contains only drag window) */
Window
root
,
child
;
...
...
dlls/x11drv/window.c
View file @
d09c3289
...
...
@@ -56,17 +56,35 @@ extern Pixmap X11DRV_BITMAP_Pixmap( HBITMAP );
/* X context to associate a hwnd to an X window */
XContext
winContext
=
0
;
Atom
wmProtocols
=
None
;
Atom
wmDeleteWindow
=
None
;
Atom
wmTakeFocus
=
None
;
Atom
dndProtocol
=
None
;
Atom
dndSelection
=
None
;
Atom
wmChangeState
=
None
;
Atom
mwmHints
=
None
;
Atom
kwmDockWindow
=
None
;
Atom
netwmPid
=
None
;
Atom
netwmPing
=
None
;
Atom
_kde_net_wm_system_tray_window_for
=
None
;
/* KDE 2 Final */
Atom
X11DRV_Atoms
[
NB_XATOMS
-
FIRST_XATOM
];
static
const
char
*
const
atom_names
[
NB_XATOMS
-
FIRST_XATOM
]
=
{
"CLIPBOARD"
,
"COMPOUND_TEXT"
,
"MULTIPLE"
,
"SELECTION_DATA"
,
"TARGETS"
,
"TEXT"
,
"UTF8_STRING"
,
"RAW_ASCENT"
,
"RAW_DESCENT"
,
"RAW_CAP_HEIGHT"
,
"WM_PROTOCOLS"
,
"WM_DELETE_WINDOW"
,
"WM_TAKE_FOCUS"
,
"KWM_DOCKWINDOW"
,
"DndProtocol"
,
"DndSelection"
,
"_MOTIF_WM_HINTS"
,
"_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR"
,
"_NET_WM_PID"
,
"_NET_WM_PING"
,
"_NET_WM_NAME"
,
"image/gif"
,
"text/rtf"
,
"text/richtext"
};
static
LPCSTR
whole_window_atom
;
static
LPCSTR
client_window_atom
;
...
...
@@ -336,17 +354,19 @@ void X11DRV_set_wm_hints( Display *display, WND *win )
Window
group_leader
;
XClassHint
*
class_hints
;
XWMHints
*
wm_hints
;
Atom
protocols
[
2
];
Atom
protocols
[
3
];
MwmHints
mwm_hints
;
int
i
;
wine_tsx11_lock
();
/* wm protocols */
i
=
0
;
protocols
[
i
++
]
=
wmDeleteWindow
;
if
(
wmTakeFocus
)
protocols
[
i
++
]
=
wmTakeFocus
;
if
(
netwmPing
)
protocols
[
i
++
]
=
netwmPing
;
XSetWMProtocols
(
display
,
data
->
whole_window
,
protocols
,
i
);
protocols
[
i
++
]
=
x11drv_atom
(
WM_DELETE_WINDOW
);
protocols
[
i
++
]
=
x11drv_atom
(
_NET_WM_PING
);
if
(
use_take_focus
)
protocols
[
i
++
]
=
x11drv_atom
(
WM_TAKE_FOCUS
);
XChangeProperty
(
display
,
data
->
whole_window
,
x11drv_atom
(
WM_PROTOCOLS
),
XA_ATOM
,
32
,
PropModeReplace
,
(
char
*
)
protocols
,
i
);
/* class hints */
if
((
class_hints
=
XAllocClassHint
()))
...
...
@@ -373,44 +393,40 @@ void X11DRV_set_wm_hints( Display *display, WND *win )
if
(
win
->
dwExStyle
&
WS_EX_TRAYWINDOW
)
{
int
val
=
1
;
if
(
kwmDockWindow
!=
None
)
XChangeProperty
(
display
,
data
->
whole_window
,
kwmDockWindow
,
kwmDockWindow
,
32
,
PropModeReplace
,
(
char
*
)
&
val
,
1
);
if
(
_kde_net_wm_system_tray_window_for
!=
None
)
XChangeProperty
(
display
,
data
->
whole_window
,
_kde_net_wm_system_tray_window_for
,
XA_WINDOW
,
32
,
PropModeReplace
,
(
char
*
)
&
data
->
whole_window
,
1
);
XChangeProperty
(
display
,
data
->
whole_window
,
x11drv_atom
(
KWM_DOCKWINDOW
),
x11drv_atom
(
KWM_DOCKWINDOW
),
32
,
PropModeReplace
,
(
char
*
)
&
val
,
1
);
XChangeProperty
(
display
,
data
->
whole_window
,
x11drv_atom
(
_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR
),
XA_WINDOW
,
32
,
PropModeReplace
,
(
char
*
)
&
data
->
whole_window
,
1
);
}
/* set the WM_CLIENT_MACHINE and WM_LOCALE_NAME properties */
XSetWMProperties
(
display
,
data
->
whole_window
,
NULL
,
NULL
,
NULL
,
0
,
NULL
,
NULL
,
NULL
);
/* set the pid. together, these properties are needed so the window manager can kill us if we freeze */
i
=
getpid
();
XChangeProperty
(
display
,
data
->
whole_window
,
netwmPid
,
XA_CARDINAL
,
32
,
PropModeReplace
,
(
char
*
)
&
i
,
1
);
if
(
mwmHints
!=
None
)
{
MwmHints
mwm_hints
;
mwm_hints
.
flags
=
MWM_HINTS_FUNCTIONS
|
MWM_HINTS_DECORATIONS
;
mwm_hints
.
functions
=
0
;
if
((
win
->
dwStyle
&
WS_CAPTION
)
==
WS_CAPTION
)
mwm_hints
.
functions
|=
MWM_FUNC_MOVE
;
if
(
win
->
dwStyle
&
WS_THICKFRAME
)
mwm_hints
.
functions
|=
MWM_FUNC_MOVE
|
MWM_FUNC_RESIZE
;
if
(
win
->
dwStyle
&
WS_MINIMIZEBOX
)
mwm_hints
.
functions
|=
MWM_FUNC_MINIMIZE
;
if
(
win
->
dwStyle
&
WS_MAXIMIZEBOX
)
mwm_hints
.
functions
|=
MWM_FUNC_MAXIMIZE
;
if
(
win
->
dwStyle
&
WS_SYSMENU
)
mwm_hints
.
functions
|=
MWM_FUNC_CLOSE
;
mwm_hints
.
decorations
=
0
;
if
((
win
->
dwStyle
&
WS_CAPTION
)
==
WS_CAPTION
)
mwm_hints
.
decorations
|=
MWM_DECOR_TITLE
;
if
(
win
->
dwExStyle
&
WS_EX_DLGMODALFRAME
)
mwm_hints
.
decorations
|=
MWM_DECOR_BORDER
;
else
if
(
win
->
dwStyle
&
WS_THICKFRAME
)
mwm_hints
.
decorations
|=
MWM_DECOR_BORDER
|
MWM_DECOR_RESIZEH
;
else
if
((
win
->
dwStyle
&
(
WS_DLGFRAME
|
WS_BORDER
))
==
WS_DLGFRAME
)
mwm_hints
.
decorations
|=
MWM_DECOR_BORDER
;
else
if
(
win
->
dwStyle
&
WS_BORDER
)
mwm_hints
.
decorations
|=
MWM_DECOR_BORDER
;
else
if
(
!
(
win
->
dwStyle
&
(
WS_CHILD
|
WS_POPUP
)))
mwm_hints
.
decorations
|=
MWM_DECOR_BORDER
;
if
(
win
->
dwStyle
&
WS_SYSMENU
)
mwm_hints
.
decorations
|=
MWM_DECOR_MENU
;
if
(
win
->
dwStyle
&
WS_MINIMIZEBOX
)
mwm_hints
.
decorations
|=
MWM_DECOR_MINIMIZE
;
if
(
win
->
dwStyle
&
WS_MAXIMIZEBOX
)
mwm_hints
.
decorations
|=
MWM_DECOR_MAXIMIZE
;
XChangeProperty
(
display
,
data
->
whole_window
,
mwmHints
,
mwmHints
,
32
,
PropModeReplace
,
(
char
*
)
&
mwm_hints
,
sizeof
(
mwm_hints
)
/
sizeof
(
long
)
);
}
XChangeProperty
(
display
,
data
->
whole_window
,
x11drv_atom
(
_NET_WM_PID
),
XA_CARDINAL
,
32
,
PropModeReplace
,
(
char
*
)
&
i
,
1
);
mwm_hints
.
flags
=
MWM_HINTS_FUNCTIONS
|
MWM_HINTS_DECORATIONS
;
mwm_hints
.
functions
=
0
;
if
((
win
->
dwStyle
&
WS_CAPTION
)
==
WS_CAPTION
)
mwm_hints
.
functions
|=
MWM_FUNC_MOVE
;
if
(
win
->
dwStyle
&
WS_THICKFRAME
)
mwm_hints
.
functions
|=
MWM_FUNC_MOVE
|
MWM_FUNC_RESIZE
;
if
(
win
->
dwStyle
&
WS_MINIMIZEBOX
)
mwm_hints
.
functions
|=
MWM_FUNC_MINIMIZE
;
if
(
win
->
dwStyle
&
WS_MAXIMIZEBOX
)
mwm_hints
.
functions
|=
MWM_FUNC_MAXIMIZE
;
if
(
win
->
dwStyle
&
WS_SYSMENU
)
mwm_hints
.
functions
|=
MWM_FUNC_CLOSE
;
mwm_hints
.
decorations
=
0
;
if
((
win
->
dwStyle
&
WS_CAPTION
)
==
WS_CAPTION
)
mwm_hints
.
decorations
|=
MWM_DECOR_TITLE
;
if
(
win
->
dwExStyle
&
WS_EX_DLGMODALFRAME
)
mwm_hints
.
decorations
|=
MWM_DECOR_BORDER
;
else
if
(
win
->
dwStyle
&
WS_THICKFRAME
)
mwm_hints
.
decorations
|=
MWM_DECOR_BORDER
|
MWM_DECOR_RESIZEH
;
else
if
((
win
->
dwStyle
&
(
WS_DLGFRAME
|
WS_BORDER
))
==
WS_DLGFRAME
)
mwm_hints
.
decorations
|=
MWM_DECOR_BORDER
;
else
if
(
win
->
dwStyle
&
WS_BORDER
)
mwm_hints
.
decorations
|=
MWM_DECOR_BORDER
;
else
if
(
!
(
win
->
dwStyle
&
(
WS_CHILD
|
WS_POPUP
)))
mwm_hints
.
decorations
|=
MWM_DECOR_BORDER
;
if
(
win
->
dwStyle
&
WS_SYSMENU
)
mwm_hints
.
decorations
|=
MWM_DECOR_MENU
;
if
(
win
->
dwStyle
&
WS_MINIMIZEBOX
)
mwm_hints
.
decorations
|=
MWM_DECOR_MINIMIZE
;
if
(
win
->
dwStyle
&
WS_MAXIMIZEBOX
)
mwm_hints
.
decorations
|=
MWM_DECOR_MAXIMIZE
;
XChangeProperty
(
display
,
data
->
whole_window
,
x11drv_atom
(
_MOTIF_WM_HINTS
),
x11drv_atom
(
_MOTIF_WM_HINTS
),
32
,
PropModeReplace
,
(
char
*
)
&
mwm_hints
,
sizeof
(
mwm_hints
)
/
sizeof
(
long
)
);
wm_hints
=
XAllocWMHints
();
wine_tsx11_unlock
();
...
...
@@ -674,18 +690,8 @@ static void create_desktop( Display *display, WND *wndPtr )
X11DRV_WND_DATA
*
data
=
wndPtr
->
pDriverData
;
wine_tsx11_lock
();
winContext
=
XUniqueContext
();
wmProtocols
=
XInternAtom
(
display
,
"WM_PROTOCOLS"
,
False
);
wmDeleteWindow
=
XInternAtom
(
display
,
"WM_DELETE_WINDOW"
,
False
);
if
(
use_take_focus
)
wmTakeFocus
=
XInternAtom
(
display
,
"WM_TAKE_FOCUS"
,
False
);
dndProtocol
=
XInternAtom
(
display
,
"DndProtocol"
,
False
);
dndSelection
=
XInternAtom
(
display
,
"DndSelection"
,
False
);
wmChangeState
=
XInternAtom
(
display
,
"WM_CHANGE_STATE"
,
False
);
mwmHints
=
XInternAtom
(
display
,
_XA_MWM_HINTS
,
False
);
kwmDockWindow
=
XInternAtom
(
display
,
"KWM_DOCKWINDOW"
,
False
);
_kde_net_wm_system_tray_window_for
=
XInternAtom
(
display
,
"_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR"
,
False
);
netwmPid
=
XInternAtom
(
display
,
"_NET_WM_PID"
,
False
);
netwmPing
=
XInternAtom
(
display
,
"_NET_WM_PING"
,
False
);
winContext
=
XUniqueContext
();
XInternAtoms
(
display
,
(
char
**
)
atom_names
,
NB_XATOMS
-
FIRST_XATOM
,
False
,
X11DRV_Atoms
);
wine_tsx11_unlock
();
whole_window_atom
=
MAKEINTATOMA
(
GlobalAddAtomA
(
"__wine_x11_whole_window"
));
...
...
@@ -699,6 +705,8 @@ static void create_desktop( Display *display, WND *wndPtr )
SetPropA
(
wndPtr
->
hwndSelf
,
client_window_atom
,
(
HANDLE
)
root_window
);
SetPropA
(
wndPtr
->
hwndSelf
,
"__wine_x11_visual_id"
,
(
HANDLE
)
XVisualIDFromVisual
(
visual
)
);
X11DRV_InitClipboard
(
display
);
if
(
root_window
!=
DefaultRootWindow
(
display
))
X11DRV_create_desktop_thread
();
}
...
...
@@ -849,11 +857,8 @@ BOOL X11DRV_SetWindowText( HWND hwnd, LPCWSTR text )
according to the standard
( http://www.pps.jussieu.fr/~jch/software/UTF8_STRING/UTF8_STRING.text ).
*/
XChangeProperty
(
display
,
win
,
XInternAtom
(
display
,
"_NET_WM_NAME"
,
False
),
XInternAtom
(
display
,
"UTF8_STRING"
,
False
),
8
,
PropModeReplace
,
(
unsigned
char
*
)
utf8_buffer
,
count
);
XChangeProperty
(
display
,
win
,
x11drv_atom
(
_NET_WM_NAME
),
x11drv_atom
(
UTF8_STRING
),
8
,
PropModeReplace
,
(
unsigned
char
*
)
utf8_buffer
,
count
);
wine_tsx11_unlock
();
HeapFree
(
GetProcessHeap
(),
0
,
utf8_buffer
);
...
...
dlls/x11drv/x11drv.h
View file @
d09c3289
...
...
@@ -364,30 +364,43 @@ extern int use_xkb;
extern
int
use_take_focus
;
extern
int
managed_mode
;
extern
Atom
wmProtocols
;
extern
Atom
wmDeleteWindow
;
extern
Atom
wmTakeFocus
;
extern
Atom
dndProtocol
;
extern
Atom
dndSelection
;
extern
Atom
wmChangeState
;
extern
Atom
kwmDockWindow
;
extern
Atom
_kde_net_wm_system_tray_window_for
;
/* atoms */
/* X11 clipboard driver */
typedef
struct
tagPROPERTYFORMATMAP
enum
x11drv_atoms
{
LPCSTR
lpszProperty
;
LPCSTR
lpszFormat
;
}
PROPERTYFORMATMAP
;
FIRST_XATOM
=
XA_LAST_PREDEFINED
+
1
,
XATOM_CLIPBOARD
=
FIRST_XATOM
,
XATOM_COMPOUND_TEXT
,
XATOM_MULTIPLE
,
XATOM_SELECTION_DATA
,
XATOM_TARGETS
,
XATOM_TEXT
,
XATOM_UTF8_STRING
,
XATOM_RAW_ASCENT
,
XATOM_RAW_DESCENT
,
XATOM_RAW_CAP_HEIGHT
,
XATOM_WM_PROTOCOLS
,
XATOM_WM_DELETE_WINDOW
,
XATOM_WM_TAKE_FOCUS
,
XATOM_KWM_DOCKWINDOW
,
XATOM_DndProtocol
,
XATOM_DndSelection
,
XATOM__MOTIF_WM_HINTS
,
XATOM__KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR
,
XATOM__NET_WM_PID
,
XATOM__NET_WM_PING
,
XATOM__NET_WM_NAME
,
XATOM_image_gif
,
XATOM_text_rtf
,
XATOM_text_richtext
,
NB_XATOMS
};
typedef
struct
tagPROPERTYALIASMAP
{
LPCSTR
lpszProperty
;
UINT
drvDataProperty
;
LPCSTR
lpszAlias
;
UINT
drvDataAlias
;
}
PROPERTYALIASMAP
;
extern
Atom
X11DRV_Atoms
[
NB_XATOMS
-
FIRST_XATOM
];
#define x11drv_atom(name) (X11DRV_Atoms[XATOM_##name - FIRST_XATOM])
/* X11 clipboard driver */
typedef
struct
tagWINE_CLIPDATA
{
UINT
wFormatID
;
...
...
@@ -416,11 +429,7 @@ typedef struct tagWINE_CLIPFORMAT {
#define CF_FLAG_BUILTINFMT 1
/* Built-in windows format */
#define CF_FLAG_SYNTHESIZED 8
/* Implicitly converted data */
extern
Atom
xaClipboard
;
extern
Atom
xaTargets
;
extern
Atom
xaMultiple
;
extern
BOOL
X11DRV_InitClipboard
(
Display
*
display
);
extern
void
X11DRV_InitClipboard
(
Display
*
display
);
extern
void
X11DRV_CLIPBOARD_ReleaseSelection
(
Atom
selType
,
Window
w
,
HWND
hwnd
);
extern
INT
X11DRV_CountClipboardFormats
(
void
);
extern
UINT
X11DRV_EnumClipboardFormats
(
UINT
wFormat
);
...
...
dlls/x11drv/x11drv_main.c
View file @
d09c3289
...
...
@@ -379,13 +379,6 @@ static void process_attach(void)
ExitProcess
(
1
);
}
/* Initialize clipboard */
if
(
!
X11DRV_InitClipboard
(
display
))
{
ERR
(
"Couldn't Initialize clipboard.
\n
"
);
ExitProcess
(
1
);
}
#ifdef HAVE_LIBXXF86VM
/* initialize XVidMode */
X11DRV_XF86VM_Init
();
...
...
graphics/x11drv/xfont.c
View file @
d09c3289
...
...
@@ -342,9 +342,6 @@ static int fontLF = -1, fontMRU = -1; /* last free, most recently used */
#define CHECK_PFONT(pFont) ( (((UINT)(pFont) & 0xFFFF0000) == X_PFONT_MAGIC) &&\
(((UINT)(pFont) & 0x0000FFFF) < fontCacheSize) )
static
Atom
RAW_ASCENT
;
static
Atom
RAW_DESCENT
;
/***********************************************************************
* Helper macros from X distribution
*/
...
...
@@ -1067,8 +1064,7 @@ static void XFONT_GetLeading( const LPIFONTINFO16 pFI, const XFontStruct* x_fs,
if
(
pEL
)
*
pEL
=
0
;
if
(
XFT
)
{
Atom
RAW_CAP_HEIGHT
=
TSXInternAtom
(
gdi_display
,
"RAW_CAP_HEIGHT"
,
TRUE
);
if
(
TSXGetFontProperty
((
XFontStruct
*
)
x_fs
,
RAW_CAP_HEIGHT
,
&
height
))
if
(
TSXGetFontProperty
((
XFontStruct
*
)
x_fs
,
x11drv_atom
(
RAW_CAP_HEIGHT
),
&
height
))
*
pIL
=
XFT
->
ascent
-
(
INT
)(
XFT
->
pixelsize
/
1000
.
0
*
height
);
else
...
...
@@ -2032,13 +2028,10 @@ static int XLoadQueryFont_ErrorHandler(Display *dpy, XErrorEvent *event, void *a
static
XFontStruct
*
safe_XLoadQueryFont
(
Display
*
display
,
char
*
name
)
{
XFontStruct
*
ret
;
wine_tsx11_lock
();
X11DRV_expect_error
(
display
,
XLoadQueryFont_ErrorHandler
,
NULL
);
ret
=
XLoadQueryFont
(
display
,
name
);
if
(
X11DRV_check_error
())
ret
=
NULL
;
wine_tsx11_unlock
();
return
ret
;
}
...
...
@@ -3020,12 +3013,6 @@ void X11DRV_FONT_InitX11Metrics( void )
XFONT_GrowFreeList
(
0
,
fontCacheSize
-
1
);
TRACE
(
"done!
\n
"
);
/* update text caps parameter */
RAW_ASCENT
=
TSXInternAtom
(
gdi_display
,
"RAW_ASCENT"
,
TRUE
);
RAW_DESCENT
=
TSXInternAtom
(
gdi_display
,
"RAW_DESCENT"
,
TRUE
);
return
;
}
/***********************************************************************
...
...
@@ -3071,8 +3058,8 @@ static BOOL XFONT_SetX11Trans( fontObject *pfo )
TSXFree
(
fontName
);
HeapFree
(
GetProcessHeap
(),
0
,
lfd
);
TSXGetFontProperty
(
pfo
->
fs
,
RAW_ASCENT
,
&
PX
->
RAW_ASCENT
);
TSXGetFontProperty
(
pfo
->
fs
,
RAW_DESCENT
,
&
PX
->
RAW_DESCENT
);
TSXGetFontProperty
(
pfo
->
fs
,
x11drv_atom
(
RAW_ASCENT
)
,
&
PX
->
RAW_ASCENT
);
TSXGetFontProperty
(
pfo
->
fs
,
x11drv_atom
(
RAW_DESCENT
)
,
&
PX
->
RAW_DESCENT
);
PX
->
pixelsize
=
hypot
(
PX
->
a
,
PX
->
b
);
PX
->
ascent
=
PX
->
pixelsize
/
1000
.
0
*
PX
->
RAW_ASCENT
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment