Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
642584c5
Commit
642584c5
authored
Jul 13, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make x11drv fail to load when it can't open the display, instead of
killing the whole process.
parent
92462c2b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
27 deletions
+21
-27
bitmap.c
dlls/x11drv/bitmap.c
+1
-2
init.c
dlls/x11drv/init.c
+2
-3
x11drv.h
dlls/x11drv/x11drv.h
+3
-3
x11drv_main.c
dlls/x11drv/x11drv_main.c
+15
-19
No files found.
dlls/x11drv/bitmap.c
View file @
642584c5
...
...
@@ -39,7 +39,7 @@ Pixmap BITMAP_stock_pixmap; /* pixmap for the default stock bitmap */
/***********************************************************************
* X11DRV_BITMAP_Init
*/
BOOL
X11DRV_BITMAP_Init
(
void
)
void
X11DRV_BITMAP_Init
(
void
)
{
Pixmap
tmpPixmap
;
...
...
@@ -62,7 +62,6 @@ BOOL X11DRV_BITMAP_Init(void)
}
}
wine_tsx11_unlock
();
return
TRUE
;
}
/***********************************************************************
...
...
dlls/x11drv/init.c
View file @
642584c5
...
...
@@ -48,13 +48,13 @@ unsigned int text_caps = (TC_OP_CHARACTER | TC_OP_STROKE | TC_CP_STROKE |
/**********************************************************************
* X11DRV_GDI_Initialize
*/
BOOL
X11DRV_GDI_Initialize
(
Display
*
display
)
void
X11DRV_GDI_Initialize
(
Display
*
display
)
{
gdi_display
=
display
;
palette_size
=
X11DRV_PALETTE_Init
();
if
(
!
X11DRV_BITMAP_Init
())
return
FALSE
;
X11DRV_BITMAP_Init
()
;
/* Initialize XRender */
X11DRV_XRender_Init
();
...
...
@@ -65,7 +65,6 @@ BOOL X11DRV_GDI_Initialize( Display *display )
X11DRV_FONT_Init
(
&
log_pixels_x
,
&
log_pixels_y
);
horz_size
=
MulDiv
(
screen_width
,
254
,
log_pixels_x
*
10
);
vert_size
=
MulDiv
(
screen_height
,
254
,
log_pixels_y
*
10
);
return
TRUE
;
}
/**********************************************************************
...
...
dlls/x11drv/x11drv.h
View file @
642584c5
...
...
@@ -192,7 +192,7 @@ extern BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev);
/* X11 driver internal functions */
extern
BOOL
X11DRV_BITMAP_Init
(
void
);
extern
void
X11DRV_BITMAP_Init
(
void
);
extern
void
X11DRV_FONT_Init
(
int
*
log_pixels_x
,
int
*
log_pixels_y
);
struct
tagBITMAPOBJ
;
...
...
@@ -303,8 +303,8 @@ extern INT X11DRV_DCICommand(INT cbInput, const struct _DCICMD *lpCmd, LPVOID lp
* X11 GDI driver
*/
BOOL
X11DRV_GDI_Initialize
(
Display
*
display
);
void
X11DRV_GDI_Finalize
(
void
);
extern
void
X11DRV_GDI_Initialize
(
Display
*
display
);
extern
void
X11DRV_GDI_Finalize
(
void
);
extern
Display
*
gdi_display
;
/* display to use for all GDI functions */
...
...
dlls/x11drv/x11drv_main.c
View file @
642584c5
...
...
@@ -334,7 +334,7 @@ static void setup_options(void)
/***********************************************************************
* X11DRV process initialisation routine
*/
static
void
process_attach
(
void
)
static
BOOL
process_attach
(
void
)
{
Display
*
display
;
...
...
@@ -343,12 +343,8 @@ static void process_attach(void)
/* Open display */
if
(
!
(
display
=
XOpenDisplay
(
NULL
)))
{
MESSAGE
(
"x11drv: Can't open display: %s
\n
"
,
XDisplayName
(
NULL
)
);
MESSAGE
(
"Please ensure that your X server is running and that $DISPLAY is set correctly.
\n
"
);
ExitProcess
(
1
);
}
if
(
!
(
display
=
XOpenDisplay
(
NULL
)))
return
FALSE
;
fcntl
(
ConnectionNumber
(
display
),
F_SETFD
,
1
);
/* set close on exec flag */
screen
=
DefaultScreenOfDisplay
(
display
);
visual
=
DefaultVisual
(
display
,
DefaultScreen
(
display
)
);
...
...
@@ -365,12 +361,12 @@ static void process_attach(void)
if
(
depth_list
[
i
]
==
screen_depth
)
break
;
XFree
(
depth_list
);
if
(
i
>=
depth_count
)
{
MESSAGE
(
"x11drv: Depth %d not supported on this screen.
\n
"
,
screen_depth
);
ExitProcess
(
1
)
;
}
{
WARN
(
"invalid depth %d, using default
\n
"
,
screen_depth
);
screen_depth
=
0
;
}
}
else
screen_depth
=
DefaultDepthOfScreen
(
screen
);
if
(
!
screen_depth
)
screen_depth
=
DefaultDepthOfScreen
(
screen
);
/* Initialize OpenGL */
X11DRV_OpenGL_Init
(
display
);
...
...
@@ -397,11 +393,7 @@ static void process_attach(void)
}
/* initialize GDI */
if
(
!
X11DRV_GDI_Initialize
(
display
))
{
ERR
(
"Couldn't Initialize GDI.
\n
"
);
ExitProcess
(
1
);
}
X11DRV_GDI_Initialize
(
display
);
#ifdef HAVE_LIBXXF86VM
/* initialize XVidMode */
...
...
@@ -415,6 +407,8 @@ static void process_attach(void)
/* initialize DGA2 */
X11DRV_XF86DGA2_Init
();
#endif
return
TRUE
;
}
...
...
@@ -518,10 +512,12 @@ struct x11drv_thread_data *x11drv_init_thread_data(void)
*/
BOOL
WINAPI
DllMain
(
HINSTANCE
hinst
,
DWORD
reason
,
LPVOID
reserved
)
{
BOOL
ret
=
TRUE
;
switch
(
reason
)
{
case
DLL_PROCESS_ATTACH
:
process_attach
();
ret
=
process_attach
();
break
;
case
DLL_THREAD_DETACH
:
thread_detach
();
...
...
@@ -530,7 +526,7 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
process_detach
();
break
;
}
return
TRUE
;
return
ret
;
}
/***********************************************************************
...
...
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