Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
fdd95314
Commit
fdd95314
authored
Oct 07, 2009
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
globalhotkeys/xcb.c : cosmetics, make all lines fit in 80 columns
parent
700f57f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
13 deletions
+25
-13
modules/control/globalhotkeys/xcb.c
modules/control/globalhotkeys/xcb.c
+25
-13
No files found.
modules/control/globalhotkeys/xcb.c
View file @
fdd95314
...
...
@@ -165,16 +165,19 @@ static void Close( vlc_object_t *p_this )
static
unsigned
GetModifier
(
xcb_connection_t
*
p_connection
,
xcb_key_symbols_t
*
p_symbols
,
xcb_keysym_t
sym
)
{
static
const
unsigned
pi_mask
[
8
]
=
{
XCB_MOD_MASK_SHIFT
,
XCB_MOD_MASK_LOCK
,
XCB_MOD_MASK_CONTROL
,
XCB_MOD_MASK_1
,
XCB_MOD_MASK_2
,
XCB_MOD_MASK_3
,
XCB_MOD_MASK_4
,
XCB_MOD_MASK_5
XCB_MOD_MASK_SHIFT
,
XCB_MOD_MASK_LOCK
,
XCB_MOD_MASK_CONTROL
,
XCB_MOD_MASK_1
,
XCB_MOD_MASK_2
,
XCB_MOD_MASK_3
,
XCB_MOD_MASK_4
,
XCB_MOD_MASK_5
};
const
xcb_keycode_t
key
=
xcb_key_symbols_get_keycode
(
p_symbols
,
sym
);
if
(
key
==
0
)
return
0
;
xcb_get_modifier_mapping_cookie_t
r
=
xcb_get_modifier_mapping
(
p_connection
);
xcb_get_modifier_mapping_reply_t
*
p_map
=
xcb_get_modifier_mapping_reply
(
p_connection
,
r
,
NULL
);
xcb_get_modifier_mapping_cookie_t
r
=
xcb_get_modifier_mapping
(
p_connection
);
xcb_get_modifier_mapping_reply_t
*
p_map
=
xcb_get_modifier_mapping_reply
(
p_connection
,
r
,
NULL
);
if
(
!
p_map
)
return
0
;
...
...
@@ -195,7 +198,8 @@ static unsigned GetModifier( xcb_connection_t *p_connection, xcb_key_symbols_t *
free
(
p_map
);
// FIXME to check
return
i_mask
;
}
static
unsigned
GetX11Modifier
(
xcb_connection_t
*
p_connection
,
xcb_key_symbols_t
*
p_symbols
,
unsigned
i_vlc
)
static
unsigned
GetX11Modifier
(
xcb_connection_t
*
p_connection
,
xcb_key_symbols_t
*
p_symbols
,
unsigned
i_vlc
)
{
unsigned
i_mask
=
0
;
...
...
@@ -298,17 +302,23 @@ static void Mapping( intf_thread_t *p_intf )
if
(
!
i_vlc_key
)
continue
;
const
xcb_keycode_t
key
=
xcb_key_symbols_get_keycode
(
p_sys
->
p_symbols
,
GetX11Key
(
i_vlc_key
&
~
KEY_MODIFIER
)
);
const
unsigned
i_modifier
=
GetX11Modifier
(
p_sys
->
p_connection
,
p_sys
->
p_symbols
,
i_vlc_key
&
KEY_MODIFIER
);
const
xcb_keycode_t
key
=
xcb_key_symbols_get_keycode
(
p_sys
->
p_symbols
,
GetX11Key
(
i_vlc_key
&
~
KEY_MODIFIER
)
);
const
unsigned
i_modifier
=
GetX11Modifier
(
p_sys
->
p_connection
,
p_sys
->
p_symbols
,
i_vlc_key
&
KEY_MODIFIER
);
for
(
unsigned
int
j
=
0
;
j
<
sizeof
(
p_x11_modifier_ignored
)
/
sizeof
(
*
p_x11_modifier_ignored
);
j
++
)
const
size_t
max
=
sizeof
(
p_x11_modifier_ignored
)
/
sizeof
(
*
p_x11_modifier_ignored
);
for
(
unsigned
int
i
=
0
;
i
<
max
;
i
++
)
{
const
unsigned
i_ignored
=
GetModifier
(
p_sys
->
p_connection
,
p_sys
->
p_symbols
,
p_x11_modifier_ignored
[
j
]
);
if
(
j
!=
0
&&
i_ignored
==
0x00
)
const
unsigned
i_ignored
=
GetModifier
(
p_sys
->
p_connection
,
p_sys
->
p_symbols
,
p_x11_modifier_ignored
[
i
]
);
if
(
i
!=
0
&&
i_ignored
==
0x00
)
continue
;
hotkey_mapping_t
*
p_map_old
=
p_sys
->
p_map
;
p_sys
->
p_map
=
realloc
(
p_sys
->
p_map
,
sizeof
(
*
p_sys
->
p_map
)
*
(
p_sys
->
i_map
+
1
)
);
p_sys
->
p_map
=
realloc
(
p_sys
->
p_map
,
sizeof
(
*
p_sys
->
p_map
)
*
(
p_sys
->
i_map
+
1
)
);
if
(
!
p_sys
->
p_map
)
{
p_sys
->
p_map
=
p_map_old
;
...
...
@@ -342,7 +352,8 @@ static void Unregister( intf_thread_t *p_intf )
for
(
int
i
=
0
;
i
<
p_sys
->
i_map
;
i
++
)
{
const
hotkey_mapping_t
*
p_map
=
&
p_sys
->
p_map
[
i
];
xcb_ungrab_key
(
p_sys
->
p_connection
,
p_map
->
i_x11
,
p_sys
->
root
,
p_map
->
i_modifier
);
xcb_ungrab_key
(
p_sys
->
p_connection
,
p_map
->
i_x11
,
p_sys
->
root
,
p_map
->
i_modifier
);
}
}
...
...
@@ -391,7 +402,8 @@ static void *Thread( void *p_data )
if
(
p_map
->
i_x11
==
e
->
detail
&&
p_map
->
i_modifier
==
e
->
state
)
{
var_SetInteger
(
p_intf
->
p_libvlc
,
"key-action"
,
p_map
->
i_action
);
var_SetInteger
(
p_intf
->
p_libvlc
,
"key-action"
,
p_map
->
i_action
);
break
;
}
}
...
...
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