aboutsummaryrefslogtreecommitdiff
path: root/dw/layout.cc
AgeCommit message (Collapse)Author
2025-02-28Fix text under scrollbar on the leftRodrigo Arias Mallo
When the page is first layouted, we can then determine if the vertical scrollbar needs to be present. When the vertical scrollbar is on the left side, the whole content needs to be shifted to the right, so we need to allocate the top level widget again. The current fix simply marks the top level widget for allocation. Fixes: https://github.com/dillo-browser/dillo/issues/359
2025-02-05Fix several typosGevel Tekens
See: https://lists.mailman3.com/hyperkitty/list/dillo-dev@mailman3.com/thread/L3FFAINJJMIOZQNID5HC2DHKJIIIHEYH/
2024-11-14Reset resize counter when viewport size changesRodrigo Arias Mallo
To prevent the page from triggering the emergency stop at resizeIdle(), we reset the resize counter when the viewport is resized. Fixes: https://github.com/dillo-browser/dillo/issues/300
2024-11-14Only limit resizes on the top-level layoutRodrigo Arias Mallo
Buttons also have their own Layout, which will try to resize every time the window has changed. We are only interested in the top-level layout, as is the one that has a problem on some pages.
2024-10-13Add support for left scrollbarRodrigo Arias Mallo
Implements support for placing the vertical scrollbar on the left side by setting scrollbar_on_left=YES on dillorc. By default, continues to be on the right side. See: https://www.toomanyatoms.com/software/mobilized_dillo.html Authored-By: dogma
2024-08-07Stop the layouting loop after 1000 iterationsRodrigo Arias
Prevents Dillo from hoarding the CPU due to an infinite loop in the layouting. We also return the control to FLTK to update the screen and process events each 100 iterations, to keep the window responsive. It doesn't fix the root cause of the github-infinite-loop test, but it does allow the rendering to finish with no differences with the reference test.
2024-08-07Use dStrdup instead of strdupRodrigo Arias Mallo
The strdup function is not available in POSIX-2001, so we use our own implementation in dlib: dStrdup. Reviewed-by: dogma
2024-08-07Fix pedantic warningsRodrigo Arias Mallo
Reviewed-by: dogma
2024-05-03Disable "Layout::resizeIdle calls" messageRodrigo Arias Mallo
It is always shown, even when messages are turned of by "show_msg=NO", as the preferences are not available to dw. For now we disable it permanently by using the _MSG() macro. Reported-by: Kevin Koster <dillo@ombertech.com> See: https://lists.mailman3.com/hyperkitty/list/dillo-dev@mailman3.com/message/PPNR5FTO3YFDVAQCM4SDNVAF22JEV22W/
2016-08-04Revert commit #4652Jorge Arellano Cid
Introduces regressions: .-------.--------.------.-----------.-----------------------.-----.-----. | | BTG | test | pravda.ru | 4ta.html | VT | PV | | | render | t.* | #1 | #2 | Girl | footb. | horos.| | | |-------|--------|------|-----------|-----------------------|-----|-----| |d4652 | ok | ok | x a | x ic| ok | x l | x d | x n | ok | '-----------------------------------------------------------------------' Check this testsuite [1] for more details. [1] http://www.dillo.org/test/4648/test-suite.v1.txt
2016-07-17Fix Layout::viewportSizeChanged.Sebastian Geerken
2016-07-17Comment on Jorge's commit.Sebastian Geerken
2016-07-16fix Layout::viewportSizeChanged.Jorge Arellano Cid
When changing viewport size, sometimes the resize wasn't propagated properly. e.g. pravda #2 in the results below. Here follows the test suite and its results: -------------------------------------------- Legend: d4646 = dillo version #4646 in Mercurial repository. x a = Test failed, with code a = Problems 1, 9 and 3. Custom test pages at: http://www.dillo.org/test/4648/ Results Table .-------.--------.------.-----------.-----------------------.-----.-----. | | BTG | test | pravda.ru | 4ta.html | VT | PV | | | render | t.* | #1 | #2 | Girl | footb. | horos.| | | |-------|--------|------|-----------|-----------------------|-----|-----| |d4648 | ok | ok | ok | ok | ok | ok | ok | ok | ok | |d4647 | ok | ok | ok | x g | ok | ok | ok | ok | ok | |d4646 | ok | ok | x a | x l | ok | x j | x d | x n | ok | |d4645 | ok | ok | x m | x l | ok | x j | x d | ok | ok | |d4644 | ok | ok | x a | x b | ok | x j | x d | ok | x k | |incr | ok | ok | x a | x b | x c | ok | x d | ok | x k | |d4587t2|~ x f | ok | ok | ok | ok | ok | ok | x i | | |d4587+ | ok | ok | ok | ok | ok | ok | ok | x i | x k | |d4587 | ok | x e | ok | ok | ok | ok | ok | x i | x k | |d4584 | ok | x h | ok | ok | ok | ok | ok | x i | x k | -----------------------------------------------------------------------| |ok7 | ok | ok | ok | x g | ok | ok | ok | | | |tmp8 | ok | x e | | | | | | | | |tmp9 | ok | ok | | | | | | | | |tmp9.1 | ok | ok | ok | x g | ok | ok | ok | | | '-----------------------------------'-----------------------------'-----' ___________________________________________________________ / a | b | c | d | e | f | g | h | i | j | k \ incr = d4594 | 1 9 3 | 1 9 4 | 9 | 1 5 | 6 | 7 | 4 | 12 | 13 | 8 9 | 10 | 47 = prune patch '------------------------------------------------------'----' 45 = idle patch | l: 13 | m: 4 2| n: 5 9 | 46 = words patch 48 = viewportchg Problems: 1: overwrites text with images. 2: crops images (aspect ratio). 3: different layout. 4: overwrites text with float. 5: overwrites text with text. 6: CPU HOG with: t2.n, t2.n.sm 7: Missing page sections (sometimes works for the same page). 8: Small images cut in two sometimes ("ESP", "CRO", ...) 9: Wrong aspect ratio for images (text line height) 10: Page drawn with offset (but browser thinks other section is on screen). 11: CPU HOG. 12: CPU HOG with: t1, t1n, t2.n, t2.n.sm, t3. 13: overwrites text and images with text and images. Goods: *: works for the whole t.* suite. Testing (all with background images disabled): BTG: 1.- Bck/Fwd several times (first at normal then maximized). 2.- resize from max to normal several times. pravda #1: 1. Load [1] at normal size, wait most images to load, check images and check them not to overlap text, go Bck/Fwd, check again. 2. Maximize window, check images don't overlap text, check the page layout to have three main columns (the upper part). Go Bck/Fwd, check again. pravda #2: 1. Load [1] at normal size, wait most images to load, then load [2], press page down, check the "print version" float doesn't overlap text, or images (they may stack), check the two images inside it have the same size and ratio, maximize, return to normal, check the float again. 4ta: 1. Run dillo, disable images, load 4ta.html, click Girl img, go Bck/Fwd, check img, exit dillo. 2. Run dillo, disable images, load 4ta.html, click football img, go Bck/Fwd, check img, exit dillo. 3. Run dillo, disable images, load 4ta.html, click tauro img, check horoscope text, go Bck/Fwd, check h. text, click aries img, check h. text, go Bck/Fwd, check h. text, exit dillo. 4. Run dillo, disable images, load 4ta.html, click football img, go Bck/Fwd, click dep.png img, check images, go Bck/Fwd, check images. VT: 1. Load [3] at normal size, wait for most images to load, go Bck/Fwd, check images and text not to override each other. PV: 1. Load [5] at normal size, wait for most images to load, search for "re-re" with Find Text, press page down (you'll see an image), go Bck/Fwd, check the image is there. If not, you can place the cursor where the image was, if you get a hand cursor, Dillo thinks it is there. Wait for the tooltip and drag it a bit downwards to the right, Dillo will repaint from the image data. [1] http://tinyurl.com/j2yavxk [2] http://tinyurl.com/gqso9eu [3] http://tinyurl.com/msyl7x [4] http://tinyurl.com/grd6yg4 [5] http://tinyurl.com/huvf6pn
2016-07-16Fix Layout::resizeIdle()Jorge Arellano Cid
This was three year old bug, that went undiscovered (hg#2863). The patch is simpler than it looks, it's just a while cycle enclosing the body, indentation makes it look large. How to reproduce: 1. Load [5] at normal size, wait for most images to load, search for "re-re" with Find Text, press page down (you'll see an image), go Bck/Fwd, check the image is there. If not, you can place the cursor where the image was, if you get a hand cursor, Dillo thinks it is there. Wait for the tooltip and drag it a bit downwards to the right, Dillo will repaint from the image data. [5] http://tinyurl.com/huvf6pn
2016-04-27Reduce in half the redraws when scrolling.Jorge Arellano Cid
Now there's a single fl_scroll() call for each scroll operation, instead of calling fl_scroll() and then draw(). The patch also fixes support for FL_DAMAGE_EXPOSE in FltkViewport::draw(). Test data: FL_DAMAGE_CHILD = 0x01, 1 FL_DAMAGE_EXPOSE = 0x02, 2 FL_DAMAGE_SCROLL = 0x04, 4 FL_DAMAGE_OVERLAY = 0x08, 8 FL_DAMAGE_USER1 = 0x10, 16 FL_DAMAGE_USER2 = 0x20, 32 FL_DAMAGE_ALL = 0x80 128 -----------------------------------------------------------------------------. | scroll: keys | focus click | Alt-Tab | unfocus| | or mousewheel | viewport | statusbar | unfocus | focus | click | -----------------------------------------------------------------------------| d4235 | 5,5 | 16 | | 128 |128,128,128| | d4529 | 5,5 | 16 | | 128 |128,128,128| | dpatch | 5 | 16 | | 128 |128,128,128| | -----------------------------------------------------------------------------' </pre> The first column means dillo version (hg rev). The second one the FLTK damage bits received by FltkViewport::draw() per scroll operation (also viewable at dillo's stdout). The other columns show excessive calls, but that's another bug that is not as relevant as scrolling now, so feel free to ignore them by now.
2016-04-13Removed Layout::queueQueueResizeList and optimized multiple (both nested and ↵Sebastian Geerken
sequential) queueResize.
2016-01-10Do not create a StacḱingContextMgr at all. (Until positioned elements are ↵Sebastian Geerken
correctly implemented.)
2015-01-23Same simplifications for Widget::getWidgetAtPoint as for Widget::draw before.Sebastian Geerken
2015-01-23Simplified interrupted drawing. (Mouse events will follow.)Sebastian Geerken
2014-12-21Merge with main repo.Sebastian Geerken
2014-12-21trim some spacescorvid
2014-10-25Applied interruption (as used for drawing) also to Widget::getWidgetAtPoint. ↵Sebastian Geerken
(Still bugs\!)
2014-10-19Changes in drawing process: is now interruptable. (Some errors left.)Sebastian Geerken
2014-10-14Widget::stackingContextWidget; as well as some cleanup and debug messages.Sebastian Geerken
2014-09-25Some work on mouse events (getWidgetAtPoint).Sebastian Geerken
2014-09-15Z-Index and stacking contexts: start.Sebastian Geerken
2014-08-10Optimized usage of Layout::queueQueueResizeList.Sebastian Geerken
2014-08-10trim spacescorvid
...now that floats and grows are in the repo and I won't be making Sebastian's life difficult with a bunch of whitespace changes.
2014-07-17Fixed bug in Layout::resizeIdle: regard widgets which needs allocation but ↵Sebastian Geerken
not resizing (because sizeRequest has been called within another context). Also some new RTFL messages.
2014-07-12Fixed wrong assertion related to large toplevel image resources.Sebastian Geerken
2014-07-05Applied new RTFL macros (ENTER, LEAVE) to layout.cc.Sebastian Geerken
2014-06-17Some RTFL.Sebastian Geerken
2014-06-16Started work on more efficient handling of viewport size changes.Sebastian Geerken
2014-06-12Merge with main repository.Sebastian Geerken
2014-06-11'getWidgetAtPoint' is only called for allocated widgets.Sebastian Geerken
2014-05-31GROWS: First work on how to handle viewport changes.Sebastian Geerken
2014-05-30RTFLSebastian Geerken
2014-05-30Some bugfixes (GROWS).Sebastian Geerken
2014-05-29Removed size hints.Sebastian Geerken
2014-05-28Introduced Widget::container.Sebastian Geerken
2014-05-06New signal "resizeQueued" for Layout. It is used by ComplexButtonResource, ↵Sebastian Geerken
instead of "canvasSizeChange"; this seems to fix a CPU hogging problem.
2014-05-05Fixed memory leak (Layout::requestedAnchor).Sebastian Geerken
2014-03-14And more RTFL.Sebastian Geerken
2014-03-02Refined recent fix.Sebastian Geerken
2014-03-02Two more memory problems.Sebastian Geerken
2014-03-01Merge with main repo.Sebastian Geerken
2014-02-19Fixed uninitializedhood of attributes.Sebastian Geerken
2014-02-19Fixed misnaming.Sebastian Geerken
2014-02-16(i) Widget::ueueResize can now be called recursively (so to speak). (ii) ↵Sebastian Geerken
Using (i), float size changes are handled correctly.
2014-02-02trim some spacescorvid