chenyanming / nov-xwidget

The best epub reader in Emacs
85 stars 10 forks source link

Added functions that automatically resize the xwidget in the window #15

Closed yaqubroli closed 1 year ago

yaqubroli commented 1 year ago

Hello; I understand if this request isn't accepted as it's a bit of an inelegant solution.

Basically, xwidget-webkit-mode automatically resizes the webkit widget by adding xwidget-webkit-adjust-size-in-frame to the list window-size-change-functions; the problem is that this function calls xwidget-webkit-auto-adjust-size which only adjusts windows in xwidget-webkit-mode. Since our mode has a different name, the window isn't resized properly. So we need these functions to also check for windows in our mode and resize them.

This fixes the issue, but I could see this being an issue with xwidget-webkit in the long term as more and more emacs packages rely on webkit and have their own (near identical) resize functions. From the user perspective there's no performance consequences to this and it works fine, of course.