Skip to content

Commit

Permalink
Re-enable recovering from disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
denesb committed May 2, 2016
1 parent a28e136 commit 7b0f19a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 19 deletions.
4 changes: 2 additions & 2 deletions panel-plugin/i3w-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ i3_workspaces_config_load(i3WorkspacesConfig *config, XfcePanelPlugin *plugin)
"strip_workspace_numbers", FALSE);

xfce_rc_close(rc);

return TRUE;
}

Expand All @@ -135,7 +135,7 @@ i3_workspaces_config_save(i3WorkspacesConfig *config, XfcePanelPlugin *plugin)
config->strip_workspace_numbers);

xfce_rc_close(rc);

return TRUE;
}

Expand Down
15 changes: 5 additions & 10 deletions panel-plugin/i3w-plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ construct_workspaces(XfcePanelPlugin *plugin)
i3_workspaces->i3wm = i3wm_construct(&err);
if (NULL != err)
{
//TODO: error_state_on();
recover_from_disconnect(i3_workspaces);
//TODO: error_state_off();
}

connect_callbacks(i3_workspaces);
Expand Down Expand Up @@ -414,7 +412,7 @@ on_workspace_changed(i3workspace *workspace, gpointer data)
* Generate the label for the workspace button.
*/
static void
set_button_label(GtkWidget *button, i3workspace *workspace,
set_button_label(GtkWidget *button, i3workspace *workspace,
i3WorkspacesConfig *config)
{
static gchar *template = "<span foreground=\"#%06X\" weight=\"%s\">%s</span>";
Expand Down Expand Up @@ -566,14 +564,11 @@ on_ipc_shutdown(gpointer i3_w)
i3wm_destruct(i3_workspaces->i3wm);
i3_workspaces->i3wm = NULL;

//FIXME fix this
//TODO: error_state_on();
//recover_from_disconnect(i3_workspaces);
//TODO: error_state_off();
recover_from_disconnect(i3_workspaces);

//connect_callbacks(i3_workspaces);
connect_callbacks(i3_workspaces);

//add_workspaces(i3_workspaces);
add_workspaces(i3_workspaces);
}

static void
Expand All @@ -584,7 +579,7 @@ recover_from_disconnect(i3WorkspacesPlugin *i3_workspaces)
i3_workspaces->i3wm = i3wm_construct(&err);
while (NULL != err)
{
//fprintf(stderr, "Cannot connect to the i3 window manager: %s\n", err->message);
fprintf(stderr, "Cannot connect to the i3 window manager: %s\n", err->message);
g_error_free(err);
err = NULL;
i3_workspaces->i3wm = i3wm_construct(&err);
Expand Down
3 changes: 2 additions & 1 deletion panel-plugin/i3wm-delegate.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ on_ipc_shutdown_proxy(i3ipcConnection *connection, gpointer i3w);
*
* Construct the i3 windowmanager delegate struct.
*/
i3windowManager * i3wm_construct(GError **err)
i3windowManager *
i3wm_construct(GError **err)
{
i3windowManager *i3wm = g_new0(i3windowManager, 1);
GError *tmp_err = NULL;
Expand Down
11 changes: 5 additions & 6 deletions po/Makefile.in.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ exec_prefix = @exec_prefix@
datadir = @datadir@
datarootdir = @datarootdir@
libdir = @libdir@
DATADIRNAME = @DATADIRNAME@
itlocaledir = $(prefix)/$(DATADIRNAME)/locale
localedir = @localedir@
subdir = po
install_sh = @install_sh@
# Automake >= 1.8 provides @mkdir_p@.
Expand Down Expand Up @@ -81,7 +80,7 @@ INTLTOOL__v_MSGFMT_0 = @echo " MSGFMT" $@;

.po.pox:
$(MAKE) $(GETTEXT_PACKAGE).pot
$(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
$(MSGMERGE) $* $(GETTEXT_PACKAGE).pot -o $*.pox

.po.mo:
$(INTLTOOL_V_MSGFMT)$(MSGFMT) -o $@ $<
Expand Down Expand Up @@ -109,7 +108,7 @@ install-data-no: all
install-data-yes: all
linguas="$(USE_LINGUAS)"; \
for lang in $$linguas; do \
dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
dir=$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \
$(mkdir_p) $$dir; \
if test -r $$lang.gmo; then \
$(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
Expand Down Expand Up @@ -143,8 +142,8 @@ install-exec installcheck:
uninstall:
linguas="$(USE_LINGUAS)"; \
for lang in $$linguas; do \
rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
done

check: all $(GETTEXT_PACKAGE).pot
Expand Down

0 comments on commit 7b0f19a

Please sign in to comment.