Browse Source

added noopengl flag

naelstrof 7 years ago
parent
commit
0c7f1eae07
7 changed files with 11 additions and 3 deletions
  1. 1
    1
      CMakeLists.txt
  2. 3
    0
      slop.1
  3. BIN
      slop.1.gz
  4. 2
    0
      src/main.cpp
  5. 1
    0
      src/options.cpp
  6. 3
    2
      src/slop.cpp
  7. 1
    0
      src/slop.hpp

+ 1
- 1
CMakeLists.txt View File

@@ -21,7 +21,7 @@ endif()
21 21
 
22 22
 include_directories("${PROJECT_BINARY_DIR}")
23 23
 
24
-add_definitions(-DSLOP_VERSION="v5.3.24")
24
+add_definitions(-DSLOP_VERSION="v5.3.26")
25 25
 
26 26
 # The names have to be unique unfortunately.
27 27
 set(EXECUTABLE_NAME "slop")

+ 3
- 0
slop.1 View File

@@ -47,6 +47,9 @@ Disable any unnecessary cerr output. Any warnings simply won't print.
47 47
 .TP
48 48
 .BR \-k ", " \-\-nokeyboard
49 49
 Disables the ability to cancel selections with the keyboard.
50
+.TP
51
+.BR \-o ", " \-\-noopengl
52
+Disables graphics acceleration. Might be useful if you get rendering bugs.
50 53
 .SH EXAMPLES
51 54
 To emulate a windows XP selection, you can use something like this:
52 55
 .PP

BIN
slop.1.gz View File


+ 2
- 0
src/main.cpp View File

@@ -33,6 +33,7 @@ SlopOptions* getOptions( Options& options ) {
33 33
     glm::vec4 color = glm::vec4( foo->r, foo->g, foo->b, foo->a );
34 34
     options.getColor("color", 'c', color);
35 35
     options.getBool("nokeyboard", 'k', foo->nokeyboard);
36
+    options.getBool("noopengl", 'o', foo->noopengl);
36 37
     options.getString( "xdisplay", 'x', foo->xdisplay );
37 38
     options.getString( "shader", 's', foo->shader );
38 39
     foo->r = color.r;
@@ -127,6 +128,7 @@ void printHelp() {
127 128
 	std::cout << "  -f, --format=STRING           Set the output format string. Format specifiers\n";
128 129
 	std::cout << "                                  are %x, %y, %w, %h, %i, %g, and %c.\n";
129 130
 	std::cout << "                                  (default=`%g\n')\n";
131
+	std::cout << "  -o, --noopengl                Disable graphics acceleration.\n";
130 132
 	std::cout << "Examples\n";
131 133
 	std::cout << "    $ # Gray, thick, transparent border for maximum visiblity.\n";
132 134
 	std::cout << "    $ slop -b 20 -c 0.5,0.5,0.5,0.8\n";

+ 1
- 0
src/options.cpp View File

@@ -10,6 +10,7 @@ Options::Options( int argc, char** argv ) {
10 10
     validArguments.push_back( Argument( "tolerance",    't', false ) );
11 11
     validArguments.push_back( Argument( "nodecorations", 'n', false ) );
12 12
     validArguments.push_back( Argument( "nokeyboard",   'k', true ) );
13
+    validArguments.push_back( Argument( "noopengl",     'o', true ) );
13 14
     validArguments.push_back( Argument( "help",         'h', true ) );
14 15
     validArguments.push_back( Argument( "xdisplay",     'x', false ) );
15 16
     validArguments.push_back( Argument( "version",      'v', true ) );

+ 3
- 2
src/slop.cpp View File

@@ -33,6 +33,7 @@ using namespace slop;
33 33
 slop::SlopOptions::SlopOptions() {
34 34
     borderSize = 1;
35 35
     nokeyboard = false;
36
+    noopengl = false;
36 37
     nodecorations = false;
37 38
     tolerance = 2;
38 39
     padding = 0;
@@ -73,7 +74,7 @@ slop::SlopSelection slop::SlopSelect( slop::SlopOptions* options, bool* cancelle
73 74
     std::string errorstring = "";
74 75
     SlopWindow* window;
75 76
     // First we check if we have a compositor available
76
-	if ( x11->hasCompositor() ) {
77
+	if ( x11->hasCompositor() && !options->noopengl ) {
77 78
         // If we have a compositor, we try using OpenGL
78 79
         try {
79 80
             window = new SlopWindow();
@@ -86,7 +87,7 @@ slop::SlopSelection slop::SlopSelect( slop::SlopOptions* options, bool* cancelle
86 87
     }
87 88
     if ( !success ) {
88 89
         // If we fail, we launch the XShape version of slop.
89
-        if ( !quiet ) {
90
+        if ( !quiet && !options->noopengl ) {
90 91
             if ( errorstring.length() <= 0 ) {
91 92
                 errorstring += "Failed to launch OpenGL context, --shader parameter will be ignored.\n";
92 93
                 std::cerr << errorstring;

+ 1
- 0
src/slop.hpp View File

@@ -32,6 +32,7 @@ public:
32 32
     float padding;
33 33
     float tolerance;
34 34
     bool highlight;
35
+    bool noopengl;
35 36
     bool nokeyboard;
36 37
     int nodecorations;
37 38
     std::string shader;