Kaydet (Commit) 2473ab68 authored tarafından Nick Treleaven's avatar Nick Treleaven

Revert X11 workspace socket support as it needs more work; moved

to workspace-sockets branch.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5292 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 26666682
2010-10-07 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/ui_utils.h, src/socket.c, src/Makefile.am, src/ui_utils.c,
configure.ac, doc/geany.txt, doc/geany.html, wscript, TODO:
Revert X11 workspace socket support as it needs more work; moved
to workspace-sockets branch.
2010-10-06 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/geanywraplabel.c:
......
......@@ -21,6 +21,8 @@ Note: features included in brackets have lower priority.
o (sci macro support - as a plugin?)
o (parsing tags from a memory buffer instead of a file on disk)
o (tango-like icons for the symbol list)
o (per-workspace instances with socket support - see
workspace-sockets branch)
1.0:
......
......@@ -146,13 +146,6 @@ AC_SUBST(GIO_LIBS)
if test $have_gio = 1 ; then
AC_DEFINE(HAVE_GIO, 1, [Whether GIO is available])
fi
# X11
PKG_CHECK_MODULES(X11, ["x11"], have_x11=1, have_x11=0)
AC_SUBST(X11_CFLAGS)
AC_SUBST(X11_LIBS)
if test $have_x11 = 1 ; then
AC_DEFINE(HAVE_X11, 1, [Whether X11 is available])
fi
# --disable-deprecated switch for GTK2 purification
AC_ARG_ENABLE(deprecated, [ --disable-deprecated Disable deprecated GTK functions. ],
......
......@@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
<title>Geany</title>
<meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz" />
<meta name="date" content="2010-10-01" />
<meta name="date" content="2010-10-04" />
<style type="text/css">
/*
......@@ -139,7 +139,7 @@ Stylesheet for Geany's documentation based on a version of John Gabriele.
<br />Nick Treleaven
<br />Frank Lanitz</td></tr>
<tr><th class="docinfo-name">Date:</th>
<td>2010-10-01</td></tr>
<td>2010-10-04</td></tr>
<tr><th class="docinfo-name">Version:</th>
<td>0.20</td></tr>
</tbody>
......@@ -722,9 +722,9 @@ dragging the dividers.</p>
<h2><a class="toc-backref" href="#id28" id="command-line-options" name="command-line-options">Command line options</a></h2>
<table border="1" class="docutils">
<colgroup>
<col width="13%" />
<col width="25%" />
<col width="62%" />
<col width="9%" />
<col width="18%" />
<col width="72%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Short option</th>
......@@ -822,11 +822,11 @@ available if Geany was compiled with support for VTE.</td>
<tr><td><em>none</em></td>
<td>--socket-file</td>
<td><p class="first">Use this socket filename for communication with a
running Geany instance. By default Geany uses one
socket file per workspace for X Windows, otherwise
only one.</p>
<p class="last">Example:
geany --socket-file=/tmp/geany-sock-2</p>
running Geany instance. This can be used with the following
command to execute Geany on the current workspace:</p>
<pre class="last literal-block">
geany --socket-file=/tmp/geany-sock-$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}')
</pre>
</td>
</tr>
<tr><td><em>none</em></td>
......@@ -6256,7 +6256,7 @@ USE OR PERFORMANCE OF THIS SOFTWARE.</p>
<div class="footer">
<hr class="footer" />
<a class="reference" href="geany.txt">View document source</a>.
Generated on: 2010-10-04 11:04 UTC.
Generated on: 2010-10-07 14:02 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
......
......@@ -365,12 +365,10 @@ Short option Long option Function
available if Geany was compiled with support for VTE.
*none* --socket-file Use this socket filename for communication with a
running Geany instance. By default Geany uses one
socket file per workspace for X Windows, otherwise
only one.
running Geany instance. This can be used with the following
command to execute Geany on the current workspace::
Example:
geany --socket-file=/tmp/geany-sock-2
geany --socket-file=/tmp/geany-sock-$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}')
*none* --vte-lib Specify explicitly the path including filename or only
the filename to the VTE library, e.g.
......
......@@ -74,7 +74,7 @@ geany_include_HEADERS = \
INCLUDES = -I$(top_srcdir) -I$(srcdir)/../scintilla/include -I$(srcdir)/../tagmanager/include \
@GTK_CFLAGS@ @GIO_CFLAGS@ @X11_CFLAGS@
@GTK_CFLAGS@ @GIO_CFLAGS@
# tell automake we have a C++ file so it uses the C++ linker we need for Scintilla
nodist_EXTRA_geany_SOURCES = dummy.cxx
......@@ -85,9 +85,8 @@ if MINGW
geany_SOURCES = $(SRCS) win32.c win32.h
geany_LDADD = ../scintilla/libscintilla.a ../tagmanager/libtagmanager.a \
@GTK_LIBS@ @GIO_LIBS@ @X11_LIBS@ $(INTLLIBS) \
-lole32 -luuid -liberty -lwsock32 geany_private.res
geany_LDADD = ../scintilla/libscintilla.a ../tagmanager/libtagmanager.a @GTK_LIBS@ @GIO_LIBS@ \
$(INTLLIBS) -lole32 -luuid -liberty -lwsock32 geany_private.res
AM_CFLAGS = -DGEANY_DATADIR=\"data\" \
-DGEANY_DOCDIR=\"\" \
......@@ -113,8 +112,7 @@ else
geany_SOURCES = $(SRCS) vte.c vte.h
geany_LDADD = ../scintilla/libscintilla.a ../tagmanager/libtagmanager.a \
@GTK_LIBS@ @GIO_LIBS@ @X11_LIBS@ $(INTLLIBS)
geany_LDADD = ../scintilla/libscintilla.a ../tagmanager/libtagmanager.a @GTK_LIBS@ @GIO_LIBS@ $(INTLLIBS)
AM_CFLAGS = -DGEANY_DATADIR=\""$(datadir)"\" \
-DGEANY_DOCDIR=\""$(docdir)"\" \
......
......@@ -271,7 +271,6 @@ gint socket_init(gint argc, gchar **argv)
return -1;
#else
gchar *display_name = gdk_get_display();
gint workspace = ui_get_current_workspace(display_name);
gchar *hostname = utils_get_hostname();
gchar *p;
......@@ -285,8 +284,8 @@ gint socket_init(gint argc, gchar **argv)
*p = '_';
if (socket_info.file_name == NULL)
socket_info.file_name = g_strdup_printf("%s%cgeany_socket_%s_%s_ws%d",
app->configdir, G_DIR_SEPARATOR, hostname, display_name, workspace);
socket_info.file_name = g_strdup_printf("%s%cgeany_socket_%s_%s",
app->configdir, G_DIR_SEPARATOR, hostname, display_name);
g_free(display_name);
g_free(hostname);
......
......@@ -31,14 +31,6 @@
#include <ctype.h>
#include <gdk/gdkkeysyms.h>
/* For ui_get_current_workspace() */
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#endif
#include "ui_utils.h"
#include "prefs.h"
#include "sciwrappers.h"
......@@ -2461,48 +2453,3 @@ void ui_editable_insert_text_callback(GtkEditable *editable, gchar *new_text,
g_signal_stop_emission_by_name(editable, "insert-text");
}
/* Get the current visible workspace number for the given display name.
*
* If the X11 window property isn't found, 0 (the first workspace)
* is returned.
*
* Has been tested and verified to work under GNOME and KDE. Assuming that
* most other X11 desktops will work the same. For non-X11 backends it returns
* a workspace number of 0.
*
* This code is a slightly modified version of code that was ripped from Gedit
* which ripped it from Galeon. */
gint ui_get_current_workspace(const gchar *display_name)
{
#if defined(GDK_WINDOWING_X11) && defined(HAVE_X11)
GdkScreen *screen = gdk_screen_get_default();
GdkWindow *root_win = gdk_screen_get_root_window(screen);
GdkDisplay *display = gdk_display_open(display_name);
Atom type;
gint format;
gulong nitems;
gulong bytes_after;
guint *current_desktop;
gint err, result;
gint ret = 0;
gdk_error_trap_push();
result = XGetWindowProperty(GDK_DISPLAY_XDISPLAY(display), GDK_WINDOW_XID(root_win),
gdk_x11_get_xatom_by_name_for_display(display, "_NET_CURRENT_DESKTOP"),
0, G_MAXLONG, False, XA_CARDINAL, &type, &format, &nitems,
&bytes_after, (gpointer) &current_desktop);
err = gdk_error_trap_pop();
if (err == Success && result == Success)
{
if (type == XA_CARDINAL && format == 32 && nitems > 0)
ret = current_desktop[0];
XFree(current_desktop);
}
gdk_display_close(display);
return ret;
#else
return 0;
#endif
}
......@@ -321,6 +321,4 @@ gboolean ui_is_keyval_enter_or_return(guint keyval);
gint ui_get_gtk_settings_integer(const gchar *property_name, gint default_value);
gint ui_get_current_workspace(const gchar *display_name);
#endif
......@@ -226,7 +226,6 @@ def configure(conf):
else:
gtk_version = 'Unknown'
conf.check_cfg(package='gio-2.0', uselib_store='GIO', args='--cflags --libs', mandatory=False)
conf.check_cfg(package='x11', uselib_store='X11', args='--cflags --libs', mandatory=False)
# Windows specials
if is_win32:
......@@ -391,7 +390,7 @@ def build(bld):
source = geany_sources,
includes = '. src/ scintilla/include/ tagmanager/include/',
defines = 'G_LOG_DOMAIN="Geany"',
uselib = 'GTK GIO X11 WIN32 SUNOS_SOCKET',
uselib = 'GTK GIO WIN32 SUNOS_SOCKET',
uselib_local = 'scintilla tagmanager',
add_objects = 'geany-rc' if is_win32 else None
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment