Commit ebfb39e2 authored by Sergio Costas's avatar Sergio Costas

Now can compile with Gtk 3.20

parent 53d80009
......@@ -8,6 +8,7 @@ list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
enable_testing ()
option(ICON_UPDATE "Update the icon cache after installing" ON)
option(BUILD_VALADOC "Build API documentation if Valadoc is available" OFF)
option(GTK_3_20 "GTK_3_20" OFF)
if( NOT CMAKE_BUILD_TYPE )
set(CMAKE_BUILD_TYPE Release)
......
# Terminus #
A new terminal for XWindows
A new terminal for XWindows (and Wayland)
## What is it? ##
......@@ -20,6 +21,33 @@ of the new characteristics available and to use less resources (both guake and t
are written in python 2, which needs more memory, and uses Gtk2, which can be considered
obsolete).
## Compiling it ##
Just follow the classic cmake instructions:
mkdir install
cd install
cmake ..
make
sudo make install
If, during cmake stage, you receive an error for missing libraries, install them,
delete all the contents inside *install*, and run cmake again. Launching cmake
in a folder with parts of a previously failed cmake run can result in build errors
(don't ask why).
If your system has an old Gtk version (like Ubuntu yakkety yak, which has Gtk 3.20),
you would need to define GTK_3_20 to use some old functions, not available in versions
older than Gtk 3.22. You can do it this way:
mkdir install
cd install
cmake .. -DGTK_3_20=on
make
sudo make install
## Using it ##
By default, using Shift+F12 will show the Quake-like terminal, but you can change
......@@ -31,6 +59,7 @@ to have it. You can also launch it from a terminal.
Currently the number of options modificable is small, but more will become available.
## FAQ ##
Q: I use Gnome-Shell and when I show the Quake terminal, it doesn't get the focus.
......@@ -50,6 +79,7 @@ which makes use of the DBus remote control to show and hide the Quake-like termi
In Gnome Shell it is as easy as opening the Settings window, choose the "Keyboard" icon,
and add there the desired hotkey, associating it with "terminus_showhide.sh" program.
## Contacting the author ##
(C) Sergio Costas Rodriguez (raster software vigo)
......
#!/bin/bash
rm -rf install
mkdir -p install
cd install
GTK_VERSION=`pkg-config --modversion gtk+-3.0`
GTK_MINVERSION="3.22"
echo $GTK_VERSION
if [ "$GTK_VERSION" \< "3.22" ];
then
cmake .. -DGTK_3_20=on
else
cmake ..
fi
make
make DESTDIR=$1 PREFIX=/usr install
......@@ -51,6 +51,11 @@ set (APP_SOURCES ${APP_SOURCES} window.vala)
set (CUSTOM_VAPIS_LIST ${CUSTOM_VAPIS_LIST} ${CMAKE_SOURCE_DIR}/src/checkwayland.vapi)
if (GTK_3_20)
set (COMPILE_OPTIONS ${COMPILE_OPTIONS} -D GTK_3_20)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGTK_3_20 " )
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTK_3_20 " )
endif ()
set (COMPILE_OPTIONS ${COMPILE_OPTIONS} --vapidir=${CMAKE_SOURCE_DIR}/src/vapidir )
if ((${CMAKE_BUILD_TYPE} STREQUAL "Debug") OR (${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo"))
......
......@@ -371,7 +371,11 @@ namespace Terminus {
if (event.button == 3) {
this.item_copy.sensitive = this.vte_terminal.get_has_selection();
#if GTK_3_20
this.menu.popup(null,null,null,3,Gtk.get_current_event_time());
#else
this.menu.popup_at_pointer(event);
#endif
return true;
}
......
......@@ -50,11 +50,19 @@ namespace Terminus {
private int initialized;
private int get_monitor_width() {
#if GTK_3_20
return this.get_screen().get_width();
#else
return this.get_display().get_monitor_at_window(this.get_window().get_effective_toplevel()).get_geometry().width;
#endif
}
private int get_monitor_height() {
#if GTK_3_20
return this.get_screen().get_height();
#else
return this.get_display().get_monitor_at_window(this.get_window().get_effective_toplevel()).get_geometry().height;
#endif
}
public Window(bool guake_mode, Terminus.Base? terminal = null) {
......
......@@ -6,6 +6,8 @@ vala_version: 0.30
custom: terminus_gnome_shell/extension.js share/gnome-shell/extensions/showTerminusQuakeWindow@rastersoft.com
custom: terminus_gnome_shell/metadata.json share/gnome-shell/extensions/showTerminusQuakeWindow@rastersoft.com
*define: GTK_3_20
*gresource: extras_gresource_xml data/extras.gresource.xml
*vapidir: src/vapidir
......
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