aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-12-04 21:31:02 (GMT)
committerfluxgen <fluxgen>2003-12-04 21:31:02 (GMT)
commit29beda2d6be3eb6ccf849d7454a804fb966e7ccb (patch)
treec807397e72080c570094dc2a63707ae51a82935b /src
parenta8f39f0d7a97dc1a4438b7df3a667895fb23604d (diff)
downloadfluxbox_pavel-29beda2d6be3eb6ccf849d7454a804fb966e7ccb.zip
fluxbox_pavel-29beda2d6be3eb6ccf849d7454a804fb966e7ccb.tar.bz2
sync function
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/App.cc4
-rw-r--r--src/FbTk/App.hh1
-rw-r--r--src/Keys.cc4
-rw-r--r--src/Screen.cc15
-rw-r--r--src/WinClient.cc4
-rw-r--r--src/Window.cc25
-rw-r--r--src/fluxbox.cc6
7 files changed, 30 insertions, 29 deletions
diff --git a/src/FbTk/App.cc b/src/FbTk/App.cc
index 18c6e56..309bc41 100644
--- a/src/FbTk/App.cc
+++ b/src/FbTk/App.cc
@@ -55,6 +55,10 @@ App::~App() {
55 s_app = 0; 55 s_app = 0;
56} 56}
57 57
58void App::sync(bool discard) {
59 XSync(display(), discard);
60}
61
58void App::eventLoop() { 62void App::eventLoop() {
59 XEvent ev; 63 XEvent ev;
60 while (!m_done) { 64 while (!m_done) {
diff --git a/src/FbTk/App.hh b/src/FbTk/App.hh
index f5eb091..4bcffed 100644
--- a/src/FbTk/App.hh
+++ b/src/FbTk/App.hh
@@ -47,6 +47,7 @@ public:
47 virtual ~App(); 47 virtual ~App();
48 /// display connection 48 /// display connection
49 Display *display() const { return m_display; } 49 Display *display() const { return m_display; }
50 void sync(bool discard);
50 /// starts event loop 51 /// starts event loop
51 virtual void eventLoop(); 52 virtual void eventLoop();
52 /// forces an end to event loop 53 /// forces an end to event loop
diff --git a/src/Keys.cc b/src/Keys.cc
index fb677aa..d5bf786 100644
--- a/src/Keys.cc
+++ b/src/Keys.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22//$Id: Keys.cc,v 1.38 2003/10/05 07:19:30 rathnor Exp $ 22//$Id: Keys.cc,v 1.39 2003/12/04 21:31:02 fluxgen Exp $
23 23
24 24
25#include "Keys.hh" 25#include "Keys.hh"
@@ -111,7 +111,7 @@ bool Keys::load(const char *filename) {
111 //free memory of previous grabs 111 //free memory of previous grabs
112 deleteTree(); 112 deleteTree();
113 113
114 XSync(m_display, False); 114 FbTk::App::instance()->sync(false);
115 115
116 //open the file 116 //open the file
117 ifstream infile(filename); 117 ifstream infile(filename);
diff --git a/src/Screen.cc b/src/Screen.cc
index 2b18447..4a4141e 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.243 2003/12/04 00:08:05 fluxgen Exp $ 25// $Id: Screen.cc,v 1.244 2003/12/04 21:31:02 fluxgen Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -279,7 +279,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
279 SubstructureRedirectMask | KeyPressMask | KeyReleaseMask | 279 SubstructureRedirectMask | KeyPressMask | KeyReleaseMask |
280 ButtonPressMask | ButtonReleaseMask| SubstructureNotifyMask); 280 ButtonPressMask | ButtonReleaseMask| SubstructureNotifyMask);
281 281
282 XSync(disp, False); 282 FbTk::App::instance()->sync(false);
283 283
284 XSetErrorHandler((XErrorHandler) old); 284 XSetErrorHandler((XErrorHandler) old);
285 285
@@ -810,7 +810,7 @@ void BScreen::changeWorkspaceID(unsigned int id) {
810 id == m_current_workspace->workspaceID()) 810 id == m_current_workspace->workspaceID())
811 return; 811 return;
812 812
813 XSync(FbTk::App::instance()->display(), true); 813 FbTk::App::instance()->sync(true);
814 814
815 WinClient *focused_client = Fluxbox::instance()->getFocusedWindow(); 815 WinClient *focused_client = Fluxbox::instance()->getFocusedWindow();
816 FluxboxWindow *focused = 0; 816 FluxboxWindow *focused = 0;
@@ -877,7 +877,7 @@ void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS
877 } 877 }
878 878
879 879
880 XSync(FbTk::App::instance()->display(), True); 880 FbTk::App::instance()->sync(true);
881 881
882 if (win && &win->screen() == this && 882 if (win && &win->screen() == this &&
883 (! win->isStuck())) { 883 (! win->isStuck())) {
@@ -1012,7 +1012,7 @@ void BScreen::updateNetizenConfigNotify(XEvent &e) {
1012} 1012}
1013 1013
1014FluxboxWindow *BScreen::createWindow(Window client) { 1014FluxboxWindow *BScreen::createWindow(Window client) {
1015 XSync(FbTk::App::instance()->display(), false); 1015 FbTk::App::instance()->sync(false);
1016 1016
1017#ifdef SLIT 1017#ifdef SLIT
1018#ifdef KDE 1018#ifdef KDE
@@ -1121,7 +1121,7 @@ FluxboxWindow *BScreen::createWindow(Window client) {
1121 win->show(); 1121 win->show();
1122 } 1122 }
1123 1123
1124 XSync(FbTk::App::instance()->display(), False); 1124 FbTk::App::instance()->sync(false);
1125 return win; 1125 return win;
1126} 1126}
1127 1127
@@ -2005,9 +2005,8 @@ void BScreen::createStyleMenu(FbTk::Menu &menu,
2005} 2005}
2006 2006
2007void BScreen::shutdown() { 2007void BScreen::shutdown() {
2008 Display *disp = FbTk::App::instance()->display();
2009 rootWindow().setEventMask(NoEventMask); 2008 rootWindow().setEventMask(NoEventMask);
2010 XSync(disp, False); 2009 FbTk::App::instance()->sync(false);
2011 m_shutdown = true; 2010 m_shutdown = true;
2012 for_each(m_workspaces_list.begin(), 2011 for_each(m_workspaces_list.begin(),
2013 m_workspaces_list.end(), 2012 m_workspaces_list.end(),
diff --git a/src/WinClient.cc b/src/WinClient.cc
index 0e5e2e9..8e378bf 100644
--- a/src/WinClient.cc
+++ b/src/WinClient.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: WinClient.cc,v 1.30 2003/10/06 06:22:43 rathnor Exp $ 22// $Id: WinClient.cc,v 1.31 2003/12/04 21:31:02 fluxgen Exp $
23 23
24#include "WinClient.hh" 24#include "WinClient.hh"
25 25
@@ -555,7 +555,7 @@ void WinClient::removeModal() {
555 555
556bool WinClient::validateClient() const { 556bool WinClient::validateClient() const {
557 Display *display = FbTk::App::instance()->display(); 557 Display *display = FbTk::App::instance()->display();
558 XSync(display, false); 558 FbTk::App::instance()->sync(false);
559 559
560 XEvent e; 560 XEvent e;
561 if (( XCheckTypedWindowEvent(display, window(), DestroyNotify, &e) || 561 if (( XCheckTypedWindowEvent(display, window(), DestroyNotify, &e) ||
diff --git a/src/Window.cc b/src/Window.cc
index d6283e4..9dcbf28 100644
--- a/src/Window.cc
+++ b/src/Window.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: Window.cc,v 1.246 2003/11/27 22:02:28 fluxgen Exp $ 25// $Id: Window.cc,v 1.247 2003/12/04 21:31:02 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -262,7 +262,7 @@ FluxboxWindow::FluxboxWindow(WinClient &client, BScreen &scr, FbWinFrameTheme &t
262 stuck(false), m_managed(false), 262 stuck(false), m_managed(false),
263 maximized(MAX_NONE), 263 maximized(MAX_NONE),
264 m_screen(scr), 264 m_screen(scr),
265 display(0), 265 display(FbTk::App::instance()->display()),
266 m_windowmenu(*scr.menuTheme(), scr.screenNumber(), scr.imageControl(), 266 m_windowmenu(*scr.menuTheme(), scr.screenNumber(), scr.imageControl(),
267 *scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), 267 *scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
268 m_old_decoration(DECOR_NORMAL), 268 m_old_decoration(DECOR_NORMAL),
@@ -394,9 +394,6 @@ void FluxboxWindow::init() {
394 394
395 m_last_focus_time.tv_sec = m_last_focus_time.tv_usec = 0; 395 m_last_focus_time.tv_sec = m_last_focus_time.tv_usec = 0;
396 396
397 // display connection
398 display = FbTk::App::instance()->display();
399
400 m_blackbox_attrib.workspace = m_workspace_number = ~0; 397 m_blackbox_attrib.workspace = m_workspace_number = ~0;
401 398
402 m_blackbox_attrib.flags = m_blackbox_attrib.attrib = m_blackbox_attrib.stack = 0; 399 m_blackbox_attrib.flags = m_blackbox_attrib.attrib = m_blackbox_attrib.stack = 0;
@@ -558,20 +555,20 @@ void FluxboxWindow::init() {
558 if (m_shaped) 555 if (m_shaped)
559 shape(); 556 shape();
560 557
561 XSync(display, false); 558 FbTk::App::instance()->sync(false);
559
562} 560}
563 561
564/// apply shape to this window 562/// apply shape to this window
565void FluxboxWindow::shape() { 563void FluxboxWindow::shape() {
566#ifdef SHAPE 564#ifdef SHAPE
567 if (m_shaped) { 565 if (m_shaped) {
568 Display *disp = FbTk::App::instance()->display(); 566 XShapeCombineShape(display,
569 XShapeCombineShape(disp,
570 frame().window().window(), ShapeBounding, 567 frame().window().window(), ShapeBounding,
571 0, frame().clientArea().y(), // xOff, yOff 568 0, frame().clientArea().y(), // xOff, yOff
572 m_client->window(), 569 m_client->window(),
573 ShapeBounding, ShapeSet); 570 ShapeBounding, ShapeSet);
574 XFlush(disp); 571 XFlush(display);
575 } 572 }
576#endif // SHAPE 573#endif // SHAPE
577 574
@@ -1971,14 +1968,13 @@ void FluxboxWindow::handleEvent(XEvent &event) {
1971 } else { 1968 } else {
1972 m_shaped = false; 1969 m_shaped = false;
1973 // set no shape 1970 // set no shape
1974 Display *disp = FbTk::App::instance()->display(); 1971 XShapeCombineMask(display,
1975 XShapeCombineMask(disp,
1976 frame().window().window(), ShapeBounding, 1972 frame().window().window(), ShapeBounding,
1977 0, 0, 1973 0, 0,
1978 None, ShapeSet); 1974 None, ShapeSet);
1979 } 1975 }
1980 1976
1981 XSync(FbTk::App::instance()->display(), False); 1977 FbTk::App::instance()->sync(false);
1982 break; 1978 break;
1983 } 1979 }
1984#endif // SHAPE 1980#endif // SHAPE
@@ -2813,7 +2809,7 @@ void FluxboxWindow::stopMoving() {
2813 screen().hideGeometry(); 2809 screen().hideGeometry();
2814 XUngrabPointer(display, CurrentTime); 2810 XUngrabPointer(display, CurrentTime);
2815 2811
2816 XSync(display, False); //make sure the redraw is made before we continue 2812 FbTk::App::instance()->sync(false); //make sure the redraw is made before we continue
2817} 2813}
2818 2814
2819void FluxboxWindow::pauseMoving() { 2815void FluxboxWindow::pauseMoving() {
@@ -2837,7 +2833,8 @@ void FluxboxWindow::resumeMoving() {
2837 if (m_workspace_number == screen().currentWorkspaceID()) { 2833 if (m_workspace_number == screen().currentWorkspaceID()) {
2838 frame().show(); 2834 frame().show();
2839 } 2835 }
2840 XSync(display,false); 2836
2837 FbTk::App::instance()->sync(false);
2841 2838
2842 parent().drawRectangle(screen().rootTheme().opGC(), 2839 parent().drawRectangle(screen().rootTheme().opGC(),
2843 m_last_move_x, m_last_move_y, 2840 m_last_move_x, m_last_move_y,
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 6d560e6..1de7edd 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.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: fluxbox.cc,v 1.203 2003/12/03 00:49:20 fluxgen Exp $ 25// $Id: fluxbox.cc,v 1.204 2003/12/04 21:31:02 fluxgen Exp $
26 26
27#include "fluxbox.hh" 27#include "fluxbox.hh"
28 28
@@ -585,7 +585,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
585 FbTk::ThemeManager::instance().load(getStyleFilename()); 585 FbTk::ThemeManager::instance().load(getStyleFilename());
586 586
587 XSynchronize(disp, False); 587 XSynchronize(disp, False);
588 XSync(disp, False); 588 sync(false);
589 589
590 m_reconfigure_wait = m_reread_menu_wait = false; 590 m_reconfigure_wait = m_reread_menu_wait = false;
591 591
@@ -1516,7 +1516,7 @@ void Fluxbox::shutdown() {
1516 for_each(m_screen_list.begin(), m_screen_list.end(), mem_fun(&BScreen::shutdown)); 1516 for_each(m_screen_list.begin(), m_screen_list.end(), mem_fun(&BScreen::shutdown));
1517 1517
1518 m_shutdown = true; 1518 m_shutdown = true;
1519 XSync(FbTk::App::instance()->display(), False); 1519 sync(false);
1520 1520
1521} 1521}
1522 1522