ソースを参照

added noopengl flag

naelstrof 7 年 前
コミット
0c7f1eae07
共有7 個のファイルを変更した11 個の追加3 個の削除を含む
  1. 1
    1
      CMakeLists.txt
  2. 3
    0
      slop.1
  3. バイナリ
      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 ファイルの表示

21
 
21
 
22
 include_directories("${PROJECT_BINARY_DIR}")
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
 # The names have to be unique unfortunately.
26
 # The names have to be unique unfortunately.
27
 set(EXECUTABLE_NAME "slop")
27
 set(EXECUTABLE_NAME "slop")

+ 3
- 0
slop.1 ファイルの表示

47
 .TP
47
 .TP
48
 .BR \-k ", " \-\-nokeyboard
48
 .BR \-k ", " \-\-nokeyboard
49
 Disables the ability to cancel selections with the keyboard.
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
 .SH EXAMPLES
53
 .SH EXAMPLES
51
 To emulate a windows XP selection, you can use something like this:
54
 To emulate a windows XP selection, you can use something like this:
52
 .PP
55
 .PP

バイナリ
slop.1.gz ファイルの表示


+ 2
- 0
src/main.cpp ファイルの表示

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

+ 1
- 0
src/options.cpp ファイルの表示

10
     validArguments.push_back( Argument( "tolerance",    't', false ) );
10
     validArguments.push_back( Argument( "tolerance",    't', false ) );
11
     validArguments.push_back( Argument( "nodecorations", 'n', false ) );
11
     validArguments.push_back( Argument( "nodecorations", 'n', false ) );
12
     validArguments.push_back( Argument( "nokeyboard",   'k', true ) );
12
     validArguments.push_back( Argument( "nokeyboard",   'k', true ) );
13
+    validArguments.push_back( Argument( "noopengl",     'o', true ) );
13
     validArguments.push_back( Argument( "help",         'h', true ) );
14
     validArguments.push_back( Argument( "help",         'h', true ) );
14
     validArguments.push_back( Argument( "xdisplay",     'x', false ) );
15
     validArguments.push_back( Argument( "xdisplay",     'x', false ) );
15
     validArguments.push_back( Argument( "version",      'v', true ) );
16
     validArguments.push_back( Argument( "version",      'v', true ) );

+ 3
- 2
src/slop.cpp ファイルの表示

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

+ 1
- 0
src/slop.hpp ファイルの表示

32
     float padding;
32
     float padding;
33
     float tolerance;
33
     float tolerance;
34
     bool highlight;
34
     bool highlight;
35
+    bool noopengl;
35
     bool nokeyboard;
36
     bool nokeyboard;
36
     int nodecorations;
37
     int nodecorations;
37
     std::string shader;
38
     std::string shader;