Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Select xinerama display with --head=<screen> parameter

  • Loading branch information...
commit a2cc2608f7fdcef60457566062554f501bd21a0d 1 parent 5a07a43
Julian Knauer authored
Showing with 23 additions and 0 deletions.
  1. +11 −0 src/NWindow.cc
  2. +3 −0  src/NWindow.h
  3. +4 −0 src/Util.cc
  4. +5 −0 src/main.cc
11 src/NWindow.cc
View
@@ -433,6 +433,17 @@ void NWindow::set_default_selections()
}
+#ifdef USE_XINERAMA
+void NWindow::set_default_display(int display)
+{
+ std::ostringstream headstr;
+ if (this->is_xinerama) {
+ headstr << "xin_" << display;
+ select_display.select_value(headstr.str());
+ }
+}
+#endif
+
/////////////////////////////////////////////////////////////////////////////
/**
3  src/NWindow.h
View
@@ -41,6 +41,9 @@ class NWindow : public Gtk::Window {
void set_default_selections();
std::map<Glib::ustring, Glib::ustring> map_displays; // a map of current displays on the running instance to their display names
+#ifdef USE_XINERAMA
+ void set_default_display(int display);
+#endif
bool is_multihead;
bool is_xinerama;
4 src/Util.cc
View
@@ -190,6 +190,10 @@ ArgParser* create_arg_parser() {
parser->register_option("sort", _("How to sort the backgrounds. Valid options are:\n\t\t\t* alpha, for alphanumeric sort\n\t\t\t* ralpha, for reverse alphanumeric sort\n\t\t\t* time, for last modified time sort (oldest first)\n\t\t\t* rtime, for reverse last modified time sort (newest first)"), true);
parser->register_option("set-color", _("background color in hex, #000000 by default"), true);
+#ifdef USE_XINERAMA
+ parser->register_option("head", _("Select xinerama display upon start"), true);
+#endif
+
// command line set modes
Glib::ustring openp(" (");
Glib::ustring closep(")");
5 src/main.cc
View
@@ -186,6 +186,11 @@ int main (int argc, char ** argv) {
main_window->signal_delete_event().connect(sigc::bind(sigc::ptr_fun(&on_window_close_save_pos), main_window));
main_window->show();
+#ifdef USE_XINERAMA
+ if ( parser->has_argument("head") )
+ main_window->set_default_display( parser->get_intvalue("head") );
+#endif
+
if ( parser->has_argument("sort") ) {
Glib::ustring sort_mode = parser->get_value ("sort");
Thumbview::SortMode mode;
Please sign in to comment.
Something went wrong with that request. Please try again.