Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
128576c5
Commit
128576c5
authored
10 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Support CIO_KEY_QUIT in X11 mode.
parent
a1c65ae3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/conio/x_cio.c
+8
-0
8 additions, 0 deletions
src/conio/x_cio.c
src/conio/x_events.c
+10
-0
10 additions, 0 deletions
src/conio/x_events.c
src/conio/x_events.h
+2
-0
2 additions, 0 deletions
src/conio/x_events.h
with
20 additions
and
0 deletions
src/conio/x_cio.c
+
8
−
0
View file @
128576c5
...
...
@@ -348,6 +348,14 @@ int x_init(void)
xp_dlclose
(
dl
);
return
(
-
1
);
}
if
((
x11
.
XSetWMProtocols
=
xp_dlsym
(
dl
,
XSetWMProtocols
))
==
NULL
)
{
xp_dlclose
(
dl
);
return
(
-
1
);
}
if
((
x11
.
XInternAtom
=
xp_dlsym
(
dl
,
XInternAtom
))
==
NULL
)
{
xp_dlclose
(
dl
);
return
(
-
1
);
}
if
(
sem_init
(
&
pastebuf_set
,
0
,
0
))
{
xp_dlclose
(
dl
);
...
...
This diff is collapsed.
Click to expand it.
src/conio/x_events.c
+
10
−
0
View file @
128576c5
...
...
@@ -54,6 +54,7 @@ int x11_initialized=0;
/* Sets the atom to be used for copy/paste operations */
#define CONSOLE_CLIPBOARD XA_PRIMARY
static
Atom
WM_DELETE_WINDOW
=
0
;
static
Display
*
dpy
=
NULL
;
static
Window
win
;
...
...
@@ -218,6 +219,8 @@ static int init_window()
x11
.
XSetWMProperties
(
dpy
,
win
,
NULL
,
NULL
,
0
,
0
,
NULL
,
wmhints
,
NULL
);
}
WM_DELETE_WINDOW
=
x11
.
XInternAtom
(
dpy
,
"WM_DELETE_WINDOW"
,
False
);
gcv
.
function
=
GXcopy
;
gcv
.
foreground
=
white
;
gcv
.
background
=
black
;
...
...
@@ -242,6 +245,7 @@ static int init_window()
x11
.
XStoreName
(
dpy
,
win
,
"SyncConsole"
);
depth
=
DefaultDepth
(
dpy
,
DefaultScreen
(
dpy
));
x11
.
XSetWMProtocols
(
dpy
,
win
,
&
WM_DELETE_WINDOW
,
1
);
return
(
0
);
}
...
...
@@ -460,6 +464,12 @@ static void expose_rect(x,y,width,height)
static
int
x11_event
(
XEvent
*
ev
)
{
switch
(
ev
->
type
)
{
case
ClientMessage
:
if
(
ev
->
xclient
.
format
==
32
&&
ev
->
xclient
.
data
.
l
[
0
]
==
WM_DELETE_WINDOW
)
{
uint16_t
key
=
CIO_KEY_QUIT
;
write
(
key_pipe
[
1
],
&
key
,
2
);
}
break
;
/* Graphics related events */
case
ConfigureNotify
:
x11_window_xpos
=
ev
->
xconfigure
.
x
;
...
...
This diff is collapsed.
Click to expand it.
src/conio/x_events.h
+
2
−
0
View file @
128576c5
...
...
@@ -80,6 +80,8 @@ struct x11 {
Status
(
*
XGetWindowAttributes
)
(
Display
*
,
Window
,
XWindowAttributes
*
);
XWMHints
*
(
*
XAllocWMHints
)
(
void
);
void
(
*
XSetWMProperties
)
(
Display
*
,
Window
,
XTextProperty
*
,
XTextProperty
*
,
char
**
,
int
,
XSizeHints
*
,
XWMHints
*
,
XClassHint
*
);
Status
(
*
XSetWMProtocols
)
(
Display
*
,
Window
,
Atom
*
,
int
);
Atom
(
*
XInternAtom
)
(
Display
*
,
char
*
,
Bool
);
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment