Sure `open()` can open any file, but it still has to be told the path to open, the `filename` argument, it does not search the filesystem for the file. The base of the directory tree containing `geany.glade` and all the other data files Geany needs is set at compile time in a normal Geany build, which is the normal process for Linux application builds, the base directory is located differently in a Windows or an OSX build and they have different subdirectories, [see here](https://github.com/geany/geany/blob/ca16aff4c5cb73ccb6b1c9db58389a33ad027e4f...).
As @b4n noted above, there is support for building a relocatable Linux version, but its not used regularly as far as we know since none of the normal Linux distributions provide a relocatable version, they provide a version that is located in their system directory tree.
And as I noted, it may be reasonable to support specifying a prefix as a runtime option, but Geany is a volunteer project and somebody has to do it, and #1702 is marked as an enhancement for that reason.