Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit a2cc2608f7fdcef60457566062554f501bd21a0d 1 parent 5a07a43
Julian Knauer authored
11 src/NWindow.cc
@@ -433,6 +433,17 @@ void NWindow::set_default_selections()
433 433
434 434 }
435 435
  436 +#ifdef USE_XINERAMA
  437 +void NWindow::set_default_display(int display)
  438 +{
  439 + std::ostringstream headstr;
  440 + if (this->is_xinerama) {
  441 + headstr << "xin_" << display;
  442 + select_display.select_value(headstr.str());
  443 + }
  444 +}
  445 +#endif
  446 +
436 447 /////////////////////////////////////////////////////////////////////////////
437 448
438 449 /**
3  src/NWindow.h
@@ -41,6 +41,9 @@ class NWindow : public Gtk::Window {
41 41 void set_default_selections();
42 42
43 43 std::map<Glib::ustring, Glib::ustring> map_displays; // a map of current displays on the running instance to their display names
  44 +#ifdef USE_XINERAMA
  45 + void set_default_display(int display);
  46 +#endif
44 47
45 48 bool is_multihead;
46 49 bool is_xinerama;
4 src/Util.cc
@@ -190,6 +190,10 @@ ArgParser* create_arg_parser() {
190 190 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);
191 191 parser->register_option("set-color", _("background color in hex, #000000 by default"), true);
192 192
  193 +#ifdef USE_XINERAMA
  194 + parser->register_option("head", _("Select xinerama display upon start"), true);
  195 +#endif
  196 +
193 197 // command line set modes
194 198 Glib::ustring openp(" (");
195 199 Glib::ustring closep(")");
5 src/main.cc
@@ -186,6 +186,11 @@ int main (int argc, char ** argv) {
186 186 main_window->signal_delete_event().connect(sigc::bind(sigc::ptr_fun(&on_window_close_save_pos), main_window));
187 187 main_window->show();
188 188
  189 +#ifdef USE_XINERAMA
  190 + if ( parser->has_argument("head") )
  191 + main_window->set_default_display( parser->get_intvalue("head") );
  192 +#endif
  193 +
189 194 if ( parser->has_argument("sort") ) {
190 195 Glib::ustring sort_mode = parser->get_value ("sort");
191 196 Thumbview::SortMode mode;

0 comments on commit a2cc260

Please sign in to comment.
Something went wrong with that request. Please try again.