1 |
lack 11/01/19 01:01:08 |
2 |
|
3 |
Added: fluxbox-1.1.1-multiscreen.patch |
4 |
Log: |
5 |
Bug #350641: Backported upstream patch to a^Cow multi-screen setups with libX11-1.4.0 |
6 |
|
7 |
(Portage version: 2.1.9.29/cvs/Linux i686) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 x11-wm/fluxbox/files/fluxbox-1.1.1-multiscreen.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-wm/fluxbox/files/fluxbox-1.1.1-multiscreen.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-wm/fluxbox/files/fluxbox-1.1.1-multiscreen.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: fluxbox-1.1.1-multiscreen.patch |
16 |
=================================================================== |
17 |
From 95ee731d9118eec110ecb2de5c9094d561a004bd Mon Sep 17 00:00:00 2001 |
18 |
From: Mathias Gumz <akira at fluxbox dot org> |
19 |
Date: Thu, 6 Jan 2011 08:33:34 +0100 |
20 |
Subject: [PATCH] Backported bugfix: do not assume ':number.screen' as the result of 'DisplayString()' |
21 |
|
22 |
a newer xlib recently changed the result of 'DisplayString()' a little bit: |
23 |
instead of returning ':0.0' or ':1.0' it yields ':0' or ':1'. our code to |
24 |
transform this string into something that includes the currently used |
25 |
Screen worked only on something like ':0.0'. |
26 |
|
27 |
we now find the '.' after the ':' and strip that part away. |
28 |
|
29 |
Backported from e8ce9ed3a38e1b4a3e5727d408d0fac0e2ff1ada |
30 |
--- |
31 |
src/FbCommands.cc | 18 +++++++++++++++--- |
32 |
1 files changed, 15 insertions(+), 3 deletions(-) |
33 |
|
34 |
diff --git a/src/FbCommands.cc b/src/FbCommands.cc |
35 |
index fd3f71e..fc9e7a2 100644 |
36 |
--- a/src/FbCommands.cc |
37 |
+++ b/src/FbCommands.cc |
38 |
@@ -142,9 +142,13 @@ int ExecuteCmd::run() { |
39 |
if (pid) |
40 |
return pid; |
41 |
|
42 |
+ // 'display' is given as 'host:number.screen'. we want to give the |
43 |
+ // new app a good home, so we remove '.screen' from what is given |
44 |
+ // us from the xserver and replace it with the screen_num of the Screen |
45 |
+ // the user currently points at with the mouse |
46 |
string displaystring("DISPLAY="); |
47 |
- displaystring += DisplayString(FbTk::App::instance()->display()); |
48 |
char intbuff[64]; |
49 |
+ string display = DisplayString(FbTk::App::instance()->display()); |
50 |
int screen_num = m_screen_num; |
51 |
if (screen_num < 0) { |
52 |
if (Fluxbox::instance()->mouseScreen() == 0) |
53 |
@@ -155,6 +159,15 @@ int ExecuteCmd::run() { |
54 |
|
55 |
sprintf(intbuff, "%d", screen_num); |
56 |
|
57 |
+ // strip away the '.screen' |
58 |
+ size_t dot = display.rfind(':'); |
59 |
+ dot = display.find('.', dot); |
60 |
+ if (dot != string::npos) { // 'display' has actually a '.screen' part |
61 |
+ display.erase(dot); |
62 |
+ } |
63 |
+ display += '.'; |
64 |
+ display += intbuff; |
65 |
+ |
66 |
// get shell path from the environment |
67 |
// this process exits immediately, so we don't have to worry about memleaks |
68 |
const char *shell = getenv("SHELL"); |
69 |
@@ -162,8 +175,7 @@ int ExecuteCmd::run() { |
70 |
shell = "/bin/sh"; |
71 |
|
72 |
// remove last number of display and add screen num |
73 |
- displaystring.erase(displaystring.size()-1); |
74 |
- displaystring += intbuff; |
75 |
+ displaystring += DisplayString(FbTk::App::instance()->display()); |
76 |
|
77 |
setsid(); |
78 |
putenv(const_cast<char *>(displaystring.c_str())); |
79 |
-- |
80 |
1.7.4.rc1 |