summaryrefslogtreecommitdiffstats
path: root/dbus.c
diff options
context:
space:
mode:
authorRichard Grenville <[email protected]>2013-11-09 21:38:31 +0800
committerRichard Grenville <[email protected]>2013-11-09 21:38:31 +0800
commited99f1b2c9fe5c2ff5efe0af204b381aa9fdcc3e (patch)
tree78ef82b2d05a65aa1cd9090423460028528b6aa8 /dbus.c
parent522923dbc7f99fe0ef4bd44c6e9f761addec9de2 (diff)
downloadtdebase-ed99f1b2c9fe5c2ff5efe0af204b381aa9fdcc3e.tar.gz
tdebase-ed99f1b2c9fe5c2ff5efe0af204b381aa9fdcc3e.zip
Misc: --write-pid-path & small changes
- Add --write-pid-path to write process ID to a file, to help determining compton's process ID when -b is used. - Add a few extra targets to query through D-Bus opts_get (version, pid, etc.) and through win_get, primarily for debugging. - Add helper macros likely(), unlikely(), cmalloc(), ccalloc(), crealloc(). - Change w->opacity_set to opacity_t. Determine display_repr in session_init(), etc.
Diffstat (limited to 'dbus.c')
-rw-r--r--dbus.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/dbus.c b/dbus.c
index 1d20a061a..8aec9ea82 100644
--- a/dbus.c
+++ b/dbus.c
@@ -39,30 +39,10 @@ cdbus_init(session_t *ps) {
// Request service name
{
- // Get display name
- char *display = DisplayString(ps->dpy);
- if (!display)
- display = "unknown";
- display = mstrcpy(display);
-
- // Convert all special characters in display name to underscore
- {
- char *pdisp = display;
-
- while (*pdisp) {
- if (!isalnum(*pdisp))
- *pdisp = '_';
- ++pdisp;
- }
- }
-
// Build service name
- char *service = mstrjoin3(CDBUS_SERVICE_NAME, ".", display);
+ char *service = mstrjoin3(CDBUS_SERVICE_NAME, ".", ps->o.display_repr);
ps->dbus_service = service;
- free(display);
- display = NULL;
-
// Request for the name
int ret = dbus_bus_request_name(ps->dbus_conn, service,
DBUS_NAME_FLAG_DO_NOT_QUEUE, &err);
@@ -735,7 +715,13 @@ cdbus_process_win_get(session_t *ps, DBusMessage *msg) {
cdbus_m_win_get_do(class_instance, cdbus_reply_string);
cdbus_m_win_get_do(class_general, cdbus_reply_string);
cdbus_m_win_get_do(role, cdbus_reply_string);
+
cdbus_m_win_get_do(opacity, cdbus_reply_uint32);
+ cdbus_m_win_get_do(opacity_tgt, cdbus_reply_uint32);
+ cdbus_m_win_get_do(opacity_prop, cdbus_reply_uint32);
+ cdbus_m_win_get_do(opacity_prop_client, cdbus_reply_uint32);
+ cdbus_m_win_get_do(opacity_set, cdbus_reply_uint32);
+
cdbus_m_win_get_do(frame_opacity, cdbus_reply_double);
cdbus_m_win_get_do(left_width, cdbus_reply_uint32);
cdbus_m_win_get_do(right_width, cdbus_reply_uint32);
@@ -889,6 +875,18 @@ cdbus_process_opts_get(session_t *ps, DBusMessage *msg) {
return true; \
}
+ // version
+ if (!strcmp("version", target)) {
+ cdbus_reply_string(ps, msg, COMPTON_VERSION);
+ return true;
+ }
+
+ // pid
+ if (!strcmp("pid", target)) {
+ cdbus_reply_int32(ps, msg, getpid());
+ return true;
+ }
+
// display
if (!strcmp("display", target)) {
cdbus_reply_string(ps, msg, DisplayString(ps->dpy));
@@ -896,6 +894,8 @@ cdbus_process_opts_get(session_t *ps, DBusMessage *msg) {
}
cdbus_m_opts_get_do(config_file, cdbus_reply_string);
+ cdbus_m_opts_get_do(display_repr, cdbus_reply_string);
+ cdbus_m_opts_get_do(write_pid_path, cdbus_reply_string);
cdbus_m_opts_get_do(mark_wmwin_focused, cdbus_reply_bool);
cdbus_m_opts_get_do(mark_ovredir_focused, cdbus_reply_bool);
cdbus_m_opts_get_do(fork_after_register, cdbus_reply_bool);