summaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc52
1 files changed, 33 insertions, 19 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 54432b3..c33a5bb 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.cc,v 1.200 2003/07/03 13:57:58 fluxgen Exp $ 25// $Id: Screen.cc,v 1.201 2003/07/04 01:03:40 rathnor Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -1035,40 +1035,53 @@ FluxboxWindow *BScreen::createWindow(Window client) {
1035 return 0; 1035 return 0;
1036 } 1036 }
1037 1037
1038 bool new_win = false;
1039
1038 // check if it should be grouped with something else 1040 // check if it should be grouped with something else
1039 FluxboxWindow *win; 1041 FluxboxWindow *win;
1040 if ((win = findGroupLeft(*winclient)) != 0) { 1042 if ((win = findGroupLeft(*winclient)) != 0) {
1041 win->attachClient(*winclient); 1043 win->attachClient(*winclient);
1042 } else { 1044 Fluxbox::instance()->attachSignals(*winclient);
1043 win = new FluxboxWindow(*winclient, *this,
1044 winFrameTheme(), *menuTheme(),
1045 *layerManager().getLayer(Fluxbox::instance()->getNormalLayer()));
1046 }
1047
1048 if (!win->isManaged()) {
1049 delete win;
1050 return 0;
1051 } else { 1045 } else {
1052 1046
1053 // always put on end of focused list, if it gets focused it'll get pushed up 1047 Fluxbox::instance()->attachSignals(*winclient);
1054 // there is only the one win client at this stage 1048 if (winclient->fbwindow()) // may have been set in an atomhandler
1055 if (doFocusNew()) 1049 win = winclient->fbwindow();
1056 focused_list.push_front(&win->winClient()); 1050 else {
1057 else 1051 win = new FluxboxWindow(*winclient, *this,
1058 focused_list.push_back(&win->winClient()); 1052 winFrameTheme(), *menuTheme(),
1053 *layerManager().getLayer(Fluxbox::instance()->getNormalLayer()));
1054
1055 new_win = true;
1059 1056
1060 //TODO: is next line needed? 1057 if (!win->isManaged()) {
1061 Fluxbox::instance()->saveWindowSearch(client, win); 1058 delete win;
1059 return 0;
1060 }
1061 }
1062 }
1063
1064 // always put on end of focused list, if it gets focused it'll get pushed up
1065 // there is only the one win client at this stage
1066 if (doFocusNew())
1067 focused_list.push_front(&win->winClient());
1068 else
1069 focused_list.push_back(&win->winClient());
1070
1071 if (new_win) {
1062 setupWindowActions(*win); 1072 setupWindowActions(*win);
1063 Fluxbox::instance()->attachSignals(*win); 1073 Fluxbox::instance()->attachSignals(*win);
1064 } 1074 }
1065 1075
1076 Fluxbox::instance()->saveWindowSearch(client, win);
1077
1066 // we also need to check if another window expects this window to the left 1078 // we also need to check if another window expects this window to the left
1067 // and if so, then join it. 1079 // and if so, then join it.
1068 FluxboxWindow *otherwin = 0; 1080 FluxboxWindow *otherwin = 0;
1069 // TODO: does this do the right stuff focus-wise? 1081 // TODO: does this do the right stuff focus-wise?
1070 if ((otherwin = findGroupRight(*winclient)) && otherwin != win) 1082 if ((otherwin = findGroupRight(*winclient)) && otherwin != win) {
1071 win->attachClient(otherwin->winClient()); 1083 win->attachClient(otherwin->winClient());
1084 }
1072 1085
1073 if (!win->isIconic() && (win->workspaceNumber() == currentWorkspaceID() || win->isStuck())) { 1086 if (!win->isIconic() && (win->workspaceNumber() == currentWorkspaceID() || win->isStuck())) {
1074 win->show(); 1087 win->show();
@@ -1096,6 +1109,7 @@ FluxboxWindow *BScreen::createWindow(WinClient &client) {
1096 Fluxbox::instance()->saveWindowSearch(client.window(), win); 1109 Fluxbox::instance()->saveWindowSearch(client.window(), win);
1097 setupWindowActions(*win); 1110 setupWindowActions(*win);
1098 Fluxbox::instance()->attachSignals(*win); 1111 Fluxbox::instance()->attachSignals(*win);
1112 // winclient actions should have been setup when the WinClient was created
1099 if (win->workspaceNumber() == currentWorkspaceID() || win->isStuck()) { 1113 if (win->workspaceNumber() == currentWorkspaceID() || win->isStuck()) {
1100 win->show(); 1114 win->show();
1101 } 1115 }