OSDev.org

The Place to Start for Operating System Developers
It is currently Mon Apr 29, 2024 9:19 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Help with Window Movement
PostPosted: Wed Jul 05, 2023 11:27 pm 
Offline

Joined: Wed Apr 19, 2023 1:40 am
Posts: 19
I have been working on the window manager for my OS and I have came across an issue I was wondering if someone with more anvanced C++ skills could help me with.
Source code for the project is here https://github.com/maxtyson123/max-os

My problem is that the window is not receiving the on click event that my mouse driver raises. I have setup and debugged with GDB to find the following results:
In mouse.cpp, MouseDriver::HandleInterrupt is called correctly
In, mouse.cpp, MouseDriver::HandleInterrupt passes the event to the setup mouse event handlers
I,ve put a break point at MouseEventHandler::onMouseDownEvent and the execution stops there showing that it is reached, however the desktop (Which extends the class MouseEvent handler, and overrides the onMouseDownEvent function) does not stop execution when a break point is placed there, either meaning I am using GDB wrong or the desktop does not receive the event.
I put a break point at MouseDriver::connectMouseEventHandler and it correctly shows that the desktop is registered as an event handler.

Is there anything else I should test for? Otherwise from those testings I conclude that there might be a problem with the way I override the onMouseDownEvent function, although it could be entirely separate and something to do with window movement code, however I have tried to make the window change its colours on click and that test failed so I'm thinking the problem is that its not receiving the event.

Would someone be able to guide me why this is not working? In the meantime I will continue to try problem solve it myself.
Thanks.


Top
 Profile  
 
 Post subject: Re: Help with Window Movement
PostPosted: Fri Sep 29, 2023 7:54 pm 
Offline

Joined: Fri Nov 11, 2022 10:28 pm
Posts: 10
If you still have the problem, you should try `step` in gdb to see if the handler actually gets called. That is if step works with c++, which I am not sure of. I don't have any c++ experience so I cant help that much.


Top
 Profile  
 
 Post subject: Re: Help with Window Movement
PostPosted: Sat Sep 30, 2023 1:52 am 
Offline
Member
Member

Joined: Mon Feb 02, 2015 7:11 pm
Posts: 898
Start by:

1) Making the MouseEventHandler methods pure virtual (i.e. add "= 0" at the end of each method declaration).
2) Add the "override" keyword after each method you override in desktop.h

I suspect you might get some compile errors pointing you towards the problem.

_________________
https://github.com/kiznit/rainbow-os


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group