While working, when I changed the code to solve the bug, I made a package to compile all the changes. Made the package, install it and then, restart the laptop to check the new haiku. Suddenly, the tracer crashed, nothing is working in the new haiku.
First I understand the flow of code by writing it on the copy.
GUI -> InputWindow.h ->InputMouse.h -> InterfaceDefs.h -> InputServer.h
This is the complete workflow of code. I have printed so many logs in the code to check the flow of each file like when the particular function called. But, I was unable to test it because the tracer crashed, nothing was working in the new package.
I send the patch to the Gerrit for review, PulkoMandy reviewed it and he was gettings the error while compiling the code.
One error was removed by replacing the %d with the B_PRIdint32 while printing the integer value. And the second one is because I have two files with the name MouseSettings.h on two different paths. The server is confusing while file it has to take. So, to resolve this I keep the one file in the headers/private/input and remove the MoseSettings.h from src/preferences/input. And give its path to the Jamfile of the input preferences code.
The error resolved. PulkoMandy tests the output on another haiku, but I do not have another haiku installed on my system. Logs were printed in his side.
He suggests me other ways to test the output using ‘ssh’, qmeu, download haiku in the pen drive for testing.
What I did I have a very old laptop of my brother, its screen, keyboard, mouse nothing was working on that laptop. I attached the TV screen, USB mouse, keyboard to use it and to see the output logs.
So, what I have done in the code was, currently, the code is just for one mouse, when the setting of another mouse comes, it gets overwritten.
I made a tow different functions in the InputfaceDefs.h get_multiple_mouse_type and set_multiple_mouse_type. In which they will get the mouse_name with the mouse type value. Each mouse has a type value which gets stored in it with its name to keep them unique.
I replaced get_mouse_type and set_mouse_type with get_multiple_mouse_type and set_multiple_mouse_type in the MouseSettings.cpp. Because we were storing the types of different mouses.
In the InputServer.h file, I have made a function which will return the MouseSettings.
InputServer:: GetMouseSettings(BString mouse_name)
This function will check if the name of the mouse is stored previously in the data then, it will retrieved its settings otherwise it will point to new. I made an object of MultipleMouseSettings class which is present in the MouseSettings.cpp. Using this class I checking the stored and retrieve back the settings.
To test this I have printed some logs inside the functions but they are not getting printed!!!
At night I was sending the code to the Gerrit but, it’s not uploaded. SO, today I will send the commit again so, others can also view what I did.
I got the reply to why the tracer is crashed:
The main problem is that reusing MouseSettings.cpp in input_server, it’s trying to get the current values from itself. So the part of the code that talks to input_server (using get_mouse_map and the other functions from InterfaceDefs) must be used only in Input preferences.
Now, I don’t know how to remove these functions So, today I have fixed a video col meeting with my mentor to come out of this.
Hope so, will complete this work soon!!!
I attended the meeting with PulkoMandy from 9:00 pm to 11:00 pm. In which first I explain the changes what I have made briefly the logic which I have used. He pulls the code in his system and build it and run it before the meeting start.
On my side when the tracer crashed nothing is working, but on his side, the mouse is working because he is using the table mouse. So, it is easy to debug the code using the debugger. We find the error in the get_mouse_map status. It is calling itself, again and again, to get the value that’s why the haiku becomes slow and crashed.
To resolve this error, he made the changes in the src/add-ons/input_server/filters/shortcut_catcher/KeyInfos.cpp. Basically, to add the NULL check to take it out from the code. Because get_mouse_map() is returning the NULL. To take this out from the code NULL check is necessary.
Now, the tracer error is not more. But, he comments the _RetrieveSettings code for sometimes, by this now the mouse is moving but not working. Like not function is now called/working. While trying to solve the error, his mouse is also stopped working. He is using haiku in qmeu (QEMU is a hosted virtual machine monitor: it emulates the machine’s processor through dynamic binary translation and provides a set of different hardware and device models for the machine, enabling it to run a variety of guest operating systems.) and able to see the logs, From where he came to know, that the logs that I have printed in the functions to debug are not written which means those functions are not be called.
One thing I didn’t understand and also forget to ask him like we are making the two objects of MouseSettings, in the InputMouse.cpp and in the InputServer and in between there is an InterfaceDefs.h to make a sing between the two objects. Where the code flow after reaching to the InputServer.h?
After keep on trying we thought to continue the meeting tomorrow, till then, both will try to solve the error above.