[<<] [<] Page 1 of 1 [>] [>>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
move the window!
From: "wang" ####@####.#### Date: 28 Jul 2002 09:10:33 -0000 Message-Id: In the main fuction of nanowm we see when nanowm get a GR_EVENT_TYPE_MOUSE_POSITION event, it call do_mouse_moved(&event.mouse),and actually call container_mousemoved(window, event),at the end of this fuction we see GrMoveWindow() to move the window to new position ,but as we know if we do not press down mousebutton,we can't move the window,but I can find when and where to check if we should move the window to now position according to mouse,can anyone give an explanation? Thanks in advance! wang ####@####.#### 2002-07-28 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: [nanogui] move the window!
From: Alex Holden ####@####.#### Date: 28 Jul 2002 15:20:24 -0000 Message-Id: <3D44088B.2040201@linuxhacker.org> wang wrote: > In the main fuction of nanowm we see when > nanowm get a GR_EVENT_TYPE_MOUSE_POSITION event, > it call do_mouse_moved(&event.mouse),and actually > call container_mousemoved(window, event),at the > end of this fuction we see GrMoveWindow() to move > the window to new position ,but as we know if we > do not press down mousebutton,we can't move the > window,but I can find when and where to check if > we should move the window to now position according > to mouse,can anyone give an explanation? Before the part where the window is moved in container_mousemoved(), you'll notice the line: if(!window->active) return; In other words, "if the mouse button isn't currently pressed down on the title bar or if the window has the NOMOVE property set, return without moving the window". The reason is that when the mouse button is pressed down on the container, container_buttondown() gets called and if the mouse is in the title bar area and NOMOVE isn't set for that window, window->active gets set to GR_TRUE. Also when the mouse button is released, container_buttonup() gets called and window->active gets set to GR_FALSE. -- ------------ Alex Holden - http://www.linuxhacker.org ------------ If it doesn't work, you're not hitting it with a big enough hammer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[<<] [<] Page 1 of 1 [>] [>>] |