Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
6a4f9be6
Commit
6a4f9be6
authored
Jun 04, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XCB SD: cosmetic changes
parent
195f14da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
modules/services_discovery/xcb_apps.c
modules/services_discovery/xcb_apps.c
+20
-18
No files found.
modules/services_discovery/xcb_apps.c
View file @
6a4f9be6
...
@@ -64,13 +64,13 @@ struct services_discovery_sys_t
...
@@ -64,13 +64,13 @@ struct services_discovery_sys_t
xcb_atom_t
net_client_list
;
xcb_atom_t
net_client_list
;
xcb_atom_t
net_wm_name
;
xcb_atom_t
net_wm_name
;
xcb_window_t
root_window
;
xcb_window_t
root_window
;
void
*
node
s
;
void
*
app
s
;
};
};
static
void
*
Run
(
void
*
);
static
void
*
Run
(
void
*
);
static
void
Update
(
services_discovery_t
*
);
static
void
Update
Apps
(
services_discovery_t
*
);
static
void
Del
Item
(
void
*
);
static
void
Del
App
(
void
*
);
static
void
AddDesktop
Item
(
services_discovery_t
*
);
static
void
AddDesktop
(
services_discovery_t
*
);
static
int
vlc_sd_probe_Open
(
vlc_object_t
*
obj
)
static
int
vlc_sd_probe_Open
(
vlc_object_t
*
obj
)
{
{
...
@@ -130,7 +130,7 @@ static int Open (vlc_object_t *obj)
...
@@ -130,7 +130,7 @@ static int Open (vlc_object_t *obj)
}
}
/* Add a permanent item for the entire desktop */
/* Add a permanent item for the entire desktop */
AddDesktop
Item
(
sd
);
AddDesktop
(
sd
);
p_sys
->
root_window
=
scr
->
root
;
p_sys
->
root_window
=
scr
->
root
;
xcb_change_window_attributes
(
conn
,
scr
->
root
,
XCB_CW_EVENT_MASK
,
xcb_change_window_attributes
(
conn
,
scr
->
root
,
XCB_CW_EVENT_MASK
,
...
@@ -161,8 +161,8 @@ static int Open (vlc_object_t *obj)
...
@@ -161,8 +161,8 @@ static int Open (vlc_object_t *obj)
free
(
r
);
free
(
r
);
}
}
p_sys
->
node
s
=
NULL
;
p_sys
->
app
s
=
NULL
;
Update
(
sd
);
Update
Apps
(
sd
);
if
(
vlc_clone
(
&
p_sys
->
thread
,
Run
,
sd
,
VLC_THREAD_PRIORITY_LOW
))
if
(
vlc_clone
(
&
p_sys
->
thread
,
Run
,
sd
,
VLC_THREAD_PRIORITY_LOW
))
goto
error
;
goto
error
;
...
@@ -186,7 +186,7 @@ static void Close (vlc_object_t *obj)
...
@@ -186,7 +186,7 @@ static void Close (vlc_object_t *obj)
vlc_cancel
(
p_sys
->
thread
);
vlc_cancel
(
p_sys
->
thread
);
vlc_join
(
p_sys
->
thread
,
NULL
);
vlc_join
(
p_sys
->
thread
,
NULL
);
xcb_disconnect
(
p_sys
->
conn
);
xcb_disconnect
(
p_sys
->
conn
);
tdestroy
(
p_sys
->
nodes
,
DelItem
);
tdestroy
(
p_sys
->
apps
,
DelApp
);
free
(
p_sys
);
free
(
p_sys
);
}
}
...
@@ -214,7 +214,7 @@ static void *Run (void *data)
...
@@ -214,7 +214,7 @@ static void *Run (void *data)
const
xcb_property_notify_event_t
*
pn
=
const
xcb_property_notify_event_t
*
pn
=
(
xcb_property_notify_event_t
*
)
ev
;
(
xcb_property_notify_event_t
*
)
ev
;
if
(
pn
->
atom
==
p_sys
->
net_client_list
)
if
(
pn
->
atom
==
p_sys
->
net_client_list
)
Update
(
sd
);
Update
Apps
(
sd
);
}
}
free
(
ev
);
free
(
ev
);
}
}
...
@@ -223,6 +223,7 @@ static void *Run (void *data)
...
@@ -223,6 +223,7 @@ static void *Run (void *data)
return
NULL
;
return
NULL
;
}
}
/*** Application windows ***/
struct
app
struct
app
{
{
xcb_window_t
xid
;
/* must be first for cmpapp */
xcb_window_t
xid
;
/* must be first for cmpapp */
...
@@ -230,7 +231,7 @@ struct app
...
@@ -230,7 +231,7 @@ struct app
services_discovery_t
*
owner
;
services_discovery_t
*
owner
;
};
};
static
struct
app
*
Add
Item
(
services_discovery_t
*
sd
,
xcb_window_t
xid
)
static
struct
app
*
Add
App
(
services_discovery_t
*
sd
,
xcb_window_t
xid
)
{
{
services_discovery_sys_t
*
p_sys
=
sd
->
p_sys
;
services_discovery_sys_t
*
p_sys
=
sd
->
p_sys
;
char
*
mrl
,
*
name
;
char
*
mrl
,
*
name
;
...
@@ -276,7 +277,7 @@ static struct app *AddItem (services_discovery_t *sd, xcb_window_t xid)
...
@@ -276,7 +277,7 @@ static struct app *AddItem (services_discovery_t *sd, xcb_window_t xid)
return
app
;
return
app
;
}
}
static
void
Del
Item
(
void
*
data
)
static
void
Del
App
(
void
*
data
)
{
{
struct
app
*
app
=
data
;
struct
app
*
app
=
data
;
...
@@ -297,7 +298,7 @@ static int cmpapp (const void *a, const void *b)
...
@@ -297,7 +298,7 @@ static int cmpapp (const void *a, const void *b)
return
0
;
return
0
;
}
}
static
void
Update
(
services_discovery_t
*
sd
)
static
void
Update
Apps
(
services_discovery_t
*
sd
)
{
{
services_discovery_sys_t
*
p_sys
=
sd
->
p_sys
;
services_discovery_sys_t
*
p_sys
=
sd
->
p_sys
;
xcb_connection_t
*
conn
=
p_sys
->
conn
;
xcb_connection_t
*
conn
=
p_sys
->
conn
;
...
@@ -312,7 +313,7 @@ static void Update (services_discovery_t *sd)
...
@@ -312,7 +313,7 @@ static void Update (services_discovery_t *sd)
xcb_window_t
*
ent
=
xcb_get_property_value
(
r
);
xcb_window_t
*
ent
=
xcb_get_property_value
(
r
);
int
n
=
xcb_get_property_value_length
(
r
)
/
4
;
int
n
=
xcb_get_property_value_length
(
r
)
/
4
;
void
*
newnodes
=
NULL
,
*
oldnodes
=
p_sys
->
node
s
;
void
*
newnodes
=
NULL
,
*
oldnodes
=
p_sys
->
app
s
;
for
(
int
i
=
0
;
i
<
n
;
i
++
)
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
{
...
@@ -327,23 +328,24 @@ static void Update (services_discovery_t *sd)
...
@@ -327,23 +328,24 @@ static void Update (services_discovery_t *sd)
}
}
else
/* new entry */
else
/* new entry */
{
{
app
=
Add
Item
(
sd
,
id
);
app
=
Add
App
(
sd
,
id
);
if
(
app
==
NULL
)
if
(
app
==
NULL
)
continue
;
continue
;
}
}
pa
=
tsearch
(
app
,
&
newnodes
,
cmpapp
);
pa
=
tsearch
(
app
,
&
newnodes
,
cmpapp
);
if
(
pa
==
NULL
/* OOM */
||
*
pa
!=
app
/* buggy window manager */
)
if
(
pa
==
NULL
/* OOM */
||
*
pa
!=
app
/* buggy window manager */
)
Del
Item
(
app
);
Del
App
(
app
);
}
}
free
(
r
);
free
(
r
);
/* Remove old nodes */
/* Remove old nodes */
tdestroy
(
oldnodes
,
Del
Item
);
tdestroy
(
oldnodes
,
Del
App
);
p_sys
->
node
s
=
newnodes
;
p_sys
->
app
s
=
newnodes
;
}
}
static
void
AddDesktopItem
(
services_discovery_t
*
sd
)
/*** Whole desktop ***/
static
void
AddDesktop
(
services_discovery_t
*
sd
)
{
{
input_item_t
*
item
;
input_item_t
*
item
;
...
...
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