Browse Source

Remove globalconf.xinerama_is_active

Signed-off-by: Uli Schlachter <psychon@znc.in>
Uli Schlachter 9 years ago
parent
commit
6b2e4352bb
8 changed files with 11 additions and 52 deletions
  1. 0
    2
      globalconf.h
  2. 0
    0
      luadoc/awesome.lua
  3. 0
    0
      luadoc/root.lua
  4. 4
    6
      objects/client.c
  5. 2
    8
      property.c
  6. 1
    9
      root.c
  7. 4
    10
      screen.c
  8. 0
    17
      spawn.c

+ 0
- 2
globalconf.h View File

@@ -59,8 +59,6 @@ typedef struct
59 59
     xcb_key_symbols_t *keysyms;
60 60
     /** Logical screens */
61 61
     screen_array_t screens;
62
-    /** True if xinerama is active */
63
-    bool xinerama_is_active;
64 62
     /** Root window key bindings */
65 63
     key_array_t keys;
66 64
     /** Root window mouse bindings */

+ 0
- 0
luadoc/awesome.lua View File

@@ -33,7 +33,6 @@ module("awesome")
33 33
 --- Spawn a program.
34 34
 -- @param cmd The command to launch.
35 35
 -- @param use_sn Use startup-notification, true or false, default to true.
36 36
 -- @return Process ID if everything is OK, or an error string if an error occured.
37 37
 
38 38
 --- Add a global signal.

+ 0
- 0
luadoc/root.lua View File

@@ -30,8 +30,6 @@ module("root")
30 30
 -- event, this is a boolean value which if true make the coordinates relatives.
31 31
 -- @param x In case of a motion event, this is the X coordinate.
32 32
 -- @param y In case of a motion event, this is the Y coordinate.
33 33
 -- @name fake_input
34 34
 -- @class function
35 35
 

+ 4
- 6
objects/client.c View File

@@ -1360,12 +1360,10 @@ luaA_client_geometry(lua_State *L)
1360 1360
 static int
1361 1361
 luaA_client_set_screen(lua_State *L, client_t *c)
1362 1362
 {
1363
-    if(globalconf.xinerama_is_active)
1364
-    {
1365
-        int screen = luaL_checknumber(L, -1) - 1;
1366
-        luaA_checkscreen(screen);
1367
-        screen_client_moveto(c, &globalconf.screens.tab[screen], true);
1368
-    }
1363
+    int screen = luaL_checknumber(L, -1) - 1;
1364
+    luaA_checkscreen(screen);
1365
+    screen_client_moveto(c, &globalconf.screens.tab[screen], true);
1366
+
1369 1367
     return 0;
1370 1368
 }
1371 1369
 

+ 2
- 8
property.c View File

@@ -332,14 +332,8 @@ static int
332 332
 property_handle_xrootpmap_id(uint8_t state,
333 333
                              xcb_window_t window)
334 334
 {
335
-    if(globalconf.xinerama_is_active)
336
-        foreach(w, globalconf.wiboxes)
337
-            (*w)->need_update = true;
338
-    else
339
-    {
340
-        foreach(w, globalconf.wiboxes)
341
-           (*w)->need_update = true;
342
-    }
335
+    foreach(w, globalconf.wiboxes)
336
+       (*w)->need_update = true;
343 337
 
344 338
     return 0;
345 339
 }

+ 1
- 9
root.c View File

@@ -41,7 +41,6 @@
41 41
  * event, this is a boolean value which if true make the coordinates relatives.
42 42
  * \lparam In case of a motion event, this is the X coordinate.
43 43
  * \lparam In case of a motion event, this is the Y coordinate.
44
- * \lparam In case of a motion event, this is the screen number to move on.
45 44
  * If not specified, the current one is used.
46 45
  */
47 46
 static int
@@ -57,7 +56,6 @@ luaA_root_fake_input(lua_State *L)
57 56
     const char *stype = luaL_checklstring(L, 1, &tlen);
58 57
     uint8_t type, detail;
59 58
     int x = 0, y = 0;
60
-    xcb_window_t root = XCB_NONE;
61 59
 
62 60
     switch(a_tokenize(stype, tlen))
63 61
     {
@@ -82,12 +80,6 @@ luaA_root_fake_input(lua_State *L)
82 80
         detail = luaA_checkboolean(L, 2); /* relative to the current position or not */
83 81
         x = luaL_checknumber(L, 3);
84 82
         y = luaL_checknumber(L, 4);
85
-        if(lua_gettop(L) == 5 && !globalconf.xinerama_is_active)
86
-        {
87
-            int screen = luaL_checknumber(L, 5) - 1;
88
-            luaA_checkscreen(screen);
89
-            root = globalconf.screen->root;
90
-        }
91 83
         break;
92 84
       default:
93 85
         return 0;
@@ -97,7 +89,7 @@ luaA_root_fake_input(lua_State *L)
97 89
                         type,
98 90
                         detail,
99 91
                         XCB_CURRENT_TIME,
100
-                        root,
92
+                        XCB_NONE,
101 93
                         x, y,
102 94
                         0);
103 95
     return 0;

+ 4
- 10
screen.c View File

@@ -145,10 +145,6 @@ screen_scan_randr(void)
145 145
 
146 146
             p_delete(&screen_res_r);
147 147
 
148
-            /* If RandR provides more than 2 active CRTC, Xinerama is enabled */
149
-            if(globalconf.screens.len > 1)
150
-                globalconf.xinerama_is_active = true;
151
-
152 148
             return true;
153 149
         }
154 150
     }
@@ -159,16 +155,18 @@ screen_scan_randr(void)
159 155
 static bool
160 156
 screen_scan_xinerama(void)
161 157
 {
158
+    bool xinerama_is_active = false;
159
+
162 160
     /* Check for extension before checking for Xinerama */
163 161
     if(xcb_get_extension_data(globalconf.connection, &xcb_xinerama_id)->present)
164 162
     {
165 163
         xcb_xinerama_is_active_reply_t *xia;
166 164
         xia = xcb_xinerama_is_active_reply(globalconf.connection, xcb_xinerama_is_active(globalconf.connection), NULL);
167
-        globalconf.xinerama_is_active = xia->state;
165
+        xinerama_is_active = xia->state;
168 166
         p_delete(&xia);
169 167
     }
170 168
 
171
-    if(globalconf.xinerama_is_active)
169
+    if(xinerama_is_active)
172 170
     {
173 171
         xcb_xinerama_query_screens_reply_t *xsq;
174 172
         xcb_xinerama_screen_info_t *xsi;
@@ -249,10 +247,6 @@ screen_scan(void)
249 247
 screen_t *
250 248
 screen_getbycoord(screen_t *screen, int x, int y)
251 249
 {
252
-    /* don't waste our time */
253
-    if(!globalconf.xinerama_is_active)
254
-        return screen;
255
-
256 250
     foreach(s, globalconf.screens)
257 251
         if((x < 0 || (x >= s->geometry.x && x < s->geometry.x + s->geometry.width))
258 252
            && (y < 0 || (y >= s->geometry.y && y < s->geometry.y + s->geometry.height)))

+ 0
- 17
spawn.c View File

@@ -283,36 +283,19 @@ spawn_command(const gchar *command_line, GError **error)
283 283
  * \luastack
284 284
  * \lparam The command to launch.
285 285
  * \lparam Use startup-notification, true or false, default to true.
286
- * \lparam The optional screen number to spawn the command on.
287 286
  * \lreturn Process ID if everything is OK, or an error string if an error occured.
288 287
  */
289 288
 int
290 289
 luaA_spawn(lua_State *L)
291 290
 {
292
-    char *host, newdisplay[128];
293 291
     const char *cmd;
294 292
     bool use_sn = true;
295
-    int screen = 0, screenp, displayp;
296 293
 
297 294
     if(lua_gettop(L) >= 2)
298 295
         use_sn = luaA_checkboolean(L, 2);
299 296
 
300
-    if(lua_gettop(L) == 3)
301
-    {
302
-        screen = luaL_checknumber(L, 3) - 1;
303
-        luaA_checkscreen(screen);
304
-    }
305
-
306 297
     cmd = luaL_checkstring(L, 1);
307 298
 
308
-    if(!globalconf.xinerama_is_active)
309
-    {
310
-        xcb_parse_display(NULL, &host, &displayp, &screenp);
311
-        snprintf(newdisplay, sizeof(newdisplay), "%s:%d.%d", host, displayp, screen);
312
-        setenv("DISPLAY", newdisplay, 1);
313
-        p_delete(&host);
314
-    }
315
-
316 299
     SnLauncherContext *context = NULL;
317 300
     if(use_sn)
318 301
     {

Loading…
Cancel
Save